summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'stable-1.0'Matthias Sohn2011-06-024-1/+416
|\ | | | | | | | | | | | | | | * stable-1.0: Prepare post v1.0.0.201106011211-rc3 builds JGit v1.0.0.201106011211-rc3 Remove incubation marker blame: Compute the origin of lines in a result file
| * Prepare post v1.0.0.201106011211-rc3 buildsMatthias Sohn2011-06-012-2/+2
| | | | | | | | | | Change-Id: I4dec8eba7e35858aef65fcc10f91fad3fe5b52b9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v1.0.0.201106011211-rc3v1.0.0.201106011211-rc3Matthias Sohn2011-06-012-2/+2
| | | | | | | | | | Change-Id: I574a05200471c431b3a02ac6ff208dc6aa90f539 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Remove incubation markerMatthias Sohn2011-05-311-1/+1
| | | | | | | | | | Change-Id: I6018ce0cd3b7c8137e137848fe1f04551b257538 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * blame: Compute the origin of lines in a result fileShawn O. Pearce2011-05-313-0/+415
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BlameGenerator digs through history and discovers the origin of each line of some result file. BlameResult consumes the stream of regions created by the generator and lays them out in a table for applications to display alongside of source lines. Applications may optionally push in the working tree copy of a file using the push(String, byte[]) method, allowing the application to receive accurate line annotations for the working tree version. Lines that are uncommitted (difference between HEAD and working tree) will show up with the description given by the application as the author, or "Not Committed Yet" as a default string. Applications may also run the BlameGenerator in reverse mode using the reverse(AnyObjectId, AnyObjectId) method instead of push(). When running in the reverse mode the generator annotates lines by the commit they are removed in, rather than the commit they were added in. This allows a user to discover where a line disappeared from when they are looking at an older revision in the repository. For example: blame --reverse 16e810b2..master -L 1080, org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefDirectoryTest.java ( 1080) } 2302a6d3 (Christian Halstrick 2011-05-20 11:18:20 +0200 1081) 2302a6d3 (Christian Halstrick 2011-05-20 11:18:20 +0200 1082) /** 2302a6d3 (Christian Halstrick 2011-05-20 11:18:20 +0200 1083) * Kick the timestamp of a local file. Above we learn that line 1080 (a closing curly brace of the prior method) still exists in branch master, but the Javadoc comment below it has been removed by Christian Halstrick on May 20th as part of commit 2302a6d3. This result differs considerably from that of C Git's blame --reverse feature. JGit tells the reader which commit performed the delete, while C Git tells the reader the last commit that still contained the line, leaving it an exercise to the reader to discover the descendant that performed the removal. This is still only a basic implementation. Quite notably it is missing support for the smart block copy/move detection that the C implementation of `git blame` is well known for. Despite being incremental, the BlameGenerator can only be run once. After the generator runs it cannot be reused. A better implementation would support applications browsing through history efficiently. In regards to CQ 5110, only a little of the original code survives. CQ: 5110 Bug: 306161 Change-Id: I84b8ea4838bb7d25f4fcdd540547884704661b8f Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Merge branch 'stable-1.0'Shawn O. Pearce2011-05-315-4/+118
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-1.0: DHT: Support removing a repository name DHT: Fix thread-safety issue in AbstractWriteBuffer jgit.sh: Implement pager support Change EditList to extend ArrayList Ensure the HTTP request is fully consumed Make sure test repositories are closed Fix CloneCommand not to fetch into remote tracking branches when bare Update Eclipse IP log for 1.0 Change-Id: I6340d551482e1dda01f82496296d2038b07fa68b
| * Ensure the HTTP request is fully consumedShawn O. Pearce2011-05-311-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some servlet containers require the servlet to read the EOF marker from the input stream before a response can be output if the stream is using "Transfer-Encoding: chunked"... which is typical for any sort of large push to a repository over smart HTTP. Ensure the EOF is always read by the PackParser when it is handling the stream, and fail fast if there is more data present than expected since this does indicate a protocol error. Also ensure the EOF is read by UploadPack before it starts to output a partial response using packing progress meters. Change-Id: I131db9dea20b2324cb7c3272a814f21296bc64bd Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * Make sure test repositories are closedChristian Halstrick2011-05-314-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Some repositories created during tests are not added to the 'toClose' list in LocalDiskRepositoryTestCase. Therefore when the tests end we may have open FileHandles and on Windows this may cause the tests to fail because we can't delete those files. This is fixed by adding the possibility to explicitly add repositories to the list of repos which are closed automatically. Change-Id: I1261baeef4c7d9aaedd7c34b546393bfa005bbcc Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
| * Fix CloneCommand not to fetch into remote tracking branches when bareChristian Halstrick2011-05-312-4/+70
| | | | | | | | | | | | | | | | | | | | | | When cloning into a bare repository we should not create remote tracking branches (e.g refs/remotes/origin/testX). Branches of the remote repository should but fetched into into branches of the same name (e.g refs/heads/testX). Also add the noCheckout option which would prevent checkout after fetch. Change-Id: I5d4cc0389f3f30c53aa0065f38119af2a1430909 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* | CleanCommand: add the ability to do a dry runAbhishek Bhatnagar2011-05-311-0/+19
| | | | | | | | | | Change-Id: I7b81a7e34a771951e2e7b789b080b2bfb8656e5c Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Fix GitConstructionTest teardownRobin Rosenberg2011-05-301-0/+9
|/ | | | | | The teardown faile on Windows because the repos were not closed. Change-Id: I16cf5645558680029682f898386b061796948237 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* Merge "Let RefDirectory use FileSnapShot to handle fast updates"Chris Aniszczyk2011-05-252-25/+43
|\
| * Let RefDirectory use FileSnapShot to handle fast updatesChristian Halstrick2011-05-232-25/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since this change may affect performance and memory consumption on every access to a loose ref I explicitly made it a RFC to collect opinions. Previously RefDirectory.scanRef() was not detecting an update of a loose ref when the update didn't changed the modification time of the backing file. RefDirectory cached loose refs and the way to detect outdated cache entries was to compare lastmodification timestamp on the file representing the ref. If two updates to the same ref happen faster than the filesystem-timer granularity (for linux this is 2 seconds) there is the possiblity that we don't detect the update. Because of this bug EGit's PushOperationTest only works with 2 second sleeps inside. This change let RefDirectory use FileSnapshot to detect such situations. FileSnapshot helps to remember when a file was last read from disk and therefore enables to decide when to load a file from disk although modification time has not changed. Change-Id: I03b9a137af097ec69c4c5e2eaa512d2bdd7fe080 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Add a DiffFormatter which calculates a patch-idStefan Lay2011-05-241-0/+120
| | | | | | | | | | | | | | | | | | | | | | Adds a class which can be used to calculates a SHA1 of the diff associated with a patch, similar to git patch-id. In this version whitespace is not ignored. Change-Id: I421d15ea905e23df543082786786841cbe3ef10d Signed-off-by: Stefan Lay <stefan.lay@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Add CleanCommandTest and fix CleanCommandAbhishek Bhatnagar2011-05-241-0/+116
|/ | | | | | Bug: 334767 Change-Id: I0a836451ceb668f943b1f353dc65420157810b23 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add shortening of note ref names to NoteMapKevin Sawicki2011-05-231-0/+8
| | | | | Change-Id: I224190bbb41c7cbea38388d0148ecc6dc68f3a14 Signed-off-by: Kevin Sawicki <kevin@github.com>
* Merge "Remove rebase temporary files on checkout failure"Shawn Pearce2011-05-231-2/+39
|\
| * Remove rebase temporary files on checkout failureBernard Leach2011-05-231-2/+39
| | | | | | | | | | | | | | | | | | | | A checkout conflict during rebase setup should leave the repository in SAFE state which means ensuring that the rebase temporary files need to be removed. Bug: 346813 Change-Id: If8b758fde73ed5a452a99a195a844825a03bae1a Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Add GitAddTaskKetan Padegaonkar2011-05-231-0/+1
|/ | | | | Change-Id: Ia9a3c9f4728e13d1e62f530b1d843d09afb4eb42 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add LsRemoteCommandTestChris Aniszczyk2011-05-191-0/+160
| | | | | | Bug: 343801 Change-Id: I4a91d93428bbf7f74033fcea5823266fa52d7a0c Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Create a MergeResult for deleted/modified filesBernard Leach2011-05-191-0/+42
| | | | | | | | | | | | | | Change Ia2ab4f8dc95020f2914ff01c2bf3b1bc62a9d45d added merge support for when OURS or THEIRS was simultaneously deleted and modified. That changeset however did not add create an entry in the conflicts table so clients would see a CONFLICTING result but getConflicts() would return null. This change creates a MergeResult for the conflicting file. Bug: 345684 Change-Id: I52acb81c1729b49c9fb3e7a477c6448d8e55c317 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add reset with paths support to ResetCommandBernard Leach2011-05-191-7/+76
| | | | | | Bug: 338701 Change-Id: Id7cbce47131b459e632ddc2c9a94628c7d0b75cd Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Fix NPE in URIish when parsing an empty URIKetan Padegaonkar2011-05-191-0/+20
| | | | | Change-Id: Id1c42dc9843f62c581b9904b02150de53cf7777c Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add tests for change If203ce5Bernard Leach2011-05-182-0/+171
| | | | | | Bug: 344779 Change-Id: I1628984479d93665bf4987d6a4ff8e67ad73eb36 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Fix path filtering in LogCommandPiotr Janik2011-05-181-1/+54
| | | | | | | Bug: 346257 Change-Id: Ib897e1b4962162da9670164479a844aeea7dfcd1 Signed-off-by: Piotr Janik <janikpiotrek@gmail.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Merge "Optimize MergeAlgorithm if ours or theirs is empty"Robin Rosenberg2011-05-171-1/+19
|\
| * Optimize MergeAlgorithm if ours or theirs is emptyChristian Halstrick2011-05-171-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously when merging two contents with a non-empty base and one of the contents was empty (size == 0) and the other was modified there was a potentially expensive calculation until we finally always come to the same result -> the complete non-deleted content should collide with the empty content. This proposal adds an optimization to detect empty input content and to produce the appropriate result immediatly. Change-Id: Ie6a837260c19d808f0e99173f570ff96dd22acd3 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
* | Fix diff bug on inserted lineShawn O. Pearce2011-05-161-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the following patch on the linux 2.6.32 tag: --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -685,6 +685,7 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sc static void check_spread(struct cfs_rq *cfs_rq, struct sched_entity *se) { +#if 0 #ifdef CONFIG_SCHED_DEBUG s64 d = se->vruntime - cfs_rq->min_vruntime; @@ -694,6 +695,7 @@ static void check_spread(struct cfs_rq *cfs_rq, struct sched if (d > 3*sysctl_sched_latency) schedstat_inc(cfs_rq, nr_spread_over); #endif +#endif } static void JGit produced an incorrect diff, attempting to add a new "}" instead of the new "#endif" at the end of the hunk. This was caused by a prior fix for bug 328895 where we wanted to "slide" a diff down in the file when adding a new method/function and want to show the closing curly brace as being added after the new method, rather than added onto the end of the prior function or method just before the insertion point. Bug: 345956 Change-Id: I32b9e24f1e2980258b1b39dd1807919ab1c5f9b2 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Merge "Fix diff when first text is the start of the other"Shawn Pearce2011-05-152-0/+66
|\ \
| * | Fix diff when first text is the start of the otherRobin Rosenberg2011-05-152-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem occurred when the first text ends in the middle of the last line of the other text and the first text has no end of line. Bug: 344975 Change-Id: I1f0dd9f8062f2148a7c1341c9122202e082ad19d Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | | Merge "Add test for reflog part of ResetCommand"Chris Aniszczyk2011-05-131-0/+33
|\ \ \
| * | | Add test for reflog part of ResetCommandRobin Rosenberg2011-05-131-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reflog message fix was done in I4f1c3cd6b2cf543be213f061afb94223062dde51 Change-Id: I44817ccf4bf226ed3e4ce6fb2d923e88788221dd Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | | | RevertCommand: Add "." after reverted commit idRobin Stocker2011-05-131-2/+5
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | This makes the message look the same as in C Git (the "."): This reverts commit <sha1>. Change-Id: I4c254c122277b127e7b039c0d1c7f7a0d691530d Signed-off-by: Robin Stocker <robin@nibor.org>
* | | Formatter for relative datesMatthias Sohn2011-05-091-0/+126
| | | | | | | | | | | | | | | Change-Id: I78b307177c68c578e10101a0ee7b6306880a08f7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Fix getHumanishName broken for windows pathsStefan Lay2011-05-061-0/+11
| |/ |/| | | | | | | | | | | | | | | | | Since d1718a the method getHumanishName was broken on windows since the URIish is not normalized anymore. For a path like "C:\gitRepositories\egit" the whole path was returned instead of "egit". Bug: 343519 Change-Id: I95056009072b99d32f288966302d0f8188b47836 Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* | IndexDiff: conflicting files aren't properly shownBernard Leach2011-05-051-4/+79
| | | | | | | | | | | | | | | | | | | | Before this change any files in the conflicting set would also be listed in the the other IndexDiff Sets which is confusing. With this change a conflicting file will not be included in any of the other sets. Change-Id: Ife9f2652685220bcfddc1f9820423acdcd5acfdc Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Fix "into" part of merge message for HEADRobin Stocker2011-05-051-0/+9
|/ | | | | | | | | | | | | Merging into a non-master branch would result in the following message: Merge branch 'a' into HEAD Now the merge message is correct: Merge branch 'a' into b Change-Id: I488f97190e4c1711c23a7a3cbd64f8b13a87bbac Signed-off-by: Robin Stocker <robin@nibor.org>
* Implemented merge for parallel delete/modificationBernard Leach2011-05-032-1/+64
| | | | | | | | | Duplicates cgit behaviour for merging the case where OURS is deleted and THEIRS is modified as well as OURS is modified and THEIRS id deleted. Change-Id: Ia2ab4f8dc95020f2914ff01c2bf3b1bc62a9d45d Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Merge "Add path support to checkout command."Stefan Lay2011-05-031-0/+151
|\
| * Add path support to checkout command.Kevin Sawicki2011-05-031-0/+151
| | | | | | | | | | Change-Id: I89e8edfc6dd87d5bf8fd08704df2432720084330 Signed-off-by: Kevin Sawicki <kevin@github.com>
* | Qualify post-0.12 buildsMatthias Sohn2011-05-032-32/+32
| | | | | | | | | | Change-Id: I70fe2671321efb5c3d271121ce00299533d1b388 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge branch 'stable-0.12'Matthias Sohn2011-05-032-32/+32
|\ \ | |/ |/| | | | | * stable-0.12: JGit 0.12.1
| * JGit 0.12.1v0.12.1stable-0.12Matthias Sohn2011-05-022-32/+32
| | | | | | | | | | Change-Id: Ia6e58b466fa3ef7ddd61b40f2ad44141fe8786c4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge branch 'stable-0.12'Shawn O. Pearce2011-04-211-0/+13
|\| | | | | | | | | | | | | * stable-0.12: Fix sorting of names in RefDirectory Make running static checks configurable in maven build Add constants for gerrit change id configuration
| * Fix sorting of names in RefDirectoryShawn O. Pearce2011-04-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RefDirectory did not correctly follow the contract of RefList. The contract says if you use add() method of RefList builder, you MUST sort() it afterwards, and later every other method assumes that list is properly sorted (especially the binary search in the find() and get() methods). Instead RefDirectory class tried to scan the refs recursively while sorting every folder in the process before processing and did not call sort(). For example, when scanning the contents of refs/tags project1 string is smaller than project1-*, so it will recursively go into the folder and add these tags first and only then will add project-* ones. This will result in a broken list (any project1-* string is less than project1/* one, but they all appear after them in the list), that's why binary search will fail making loose RefList and the whole local RefMap completely unusable. Change-Id: Ibad90017e3b2435b1396b69a22520db4b1b022bb Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Added support to IndexDiff to return information on conflictsBernard Leach2011-04-191-0/+46
|/ | | | | Change-Id: I43c13eb72a44f80135c93525fce0c0280b0e64a2 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Hande latin-1 encodingLeonard Broman2011-04-111-0/+82
| | | | | | Bug: 342259 Change-Id: Ie285b8819b5ea6f9892ebafc4ebbd9c6d091d1fe Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add NotesCommand to the JGit APIChris Aniszczyk2011-04-101-0/+100
| | | | | | Bug: 334765 Change-Id: Ie0fb79671e7a741eb85651f507b8ade930bfcc20 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Create all test data in trash folderMatthias Sohn2011-04-101-1/+2
| | | | | | | | | This ensures that all test data is separated from project sources and cleaned up after the test. Previously the cloned bare test repository was created in org.eclipse.jgit.test/ and not deleted after the test run. Change-Id: I55110442e365fc8fe610f1c372f72a71ee6e1412 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add "Conflicts" section to merge message on conflictRobin Stocker2011-04-061-0/+32
| | | | | | | | The same as with cherry-pick, the commit message of a merge should include a "Conflicts" section when the merge resulted in conflicts. Change-Id: I6261dc898262322924af5ca1bef841a654b0df55 Signed-off-by: Robin Stocker <robin@nibor.org>