aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit
Commit message (Collapse)AuthorAgeFilesLines
* Fix DirCache,getEntriesWithin for empty string arguemntRobin Rosenberg2011-09-251-0/+7
| | | | Change-Id: I0bea130df611de3ef8c9251093b11c62b5442cd1
* Add a helper for parsing branch switch info out of a reflog entryRobin Rosenberg2011-09-051-0/+18
| | | | | | Change-Id: I91c7e08c4afd2562df2226887a933d93c78a0371 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix boxing warnings in PushProcessTestTomasz Zarna2011-08-241-7/+7
| | | | Change-Id: I5114968536853fb530b8a96c10def675e39c884f
* Throw JGit exception when ResetCommand got wrong refChristian Halstrick2011-08-211-0/+17
| | | | | | | | | | | | If the ResetCommand should reset to a invalid ref (e.g. HEAD in a repo whithout a single commit) it was throwing an NPE. This is fixed now by throwing a JGitInternalExcpeption. It would be nicer if we could throw a InvalidRefException, but this would modify our API. Bug: 339610 Change-Id: Iffcb4f2cca9f702176471d93c3a71e5cb3e700b1 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Fix ClassCastException in MergeCommandDenys Digtiar2011-08-211-0/+31
| | | | | | | | | | Test was added which reproduce the ClassCastException when ours or theirs merge strategy is set to MergeCommand. Merger and MergeCommand were updated in order to avoid exception. Change-Id: I4c1284b4e80d82638d0677a05e5d38182526d196 Signed-off-by: Denys Digtiar <duemir@gmail.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add ListTagCommand to JGit APIKetan Padegaonkar2011-08-211-0/+36
| | | | | | Bug: 355246 Change-Id: I11e019f3c19b4340ac7160ac8fcbadd52499d322 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Merge "Add DeleteTagCommand to JGit API"Chris Aniszczyk2011-08-211-0/+69
|\
| * Add DeleteTagCommand to JGit APITomasz Zarna2011-08-211-0/+69
| | | | | | | | | | | | Bug: 353226 Change-Id: I54ae237cab792742333a249eb5a774d5e1775af8 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Merge "PackWriter: Make want/have actual sets"Christian Halstrick2011-08-181-15/+15
|\ \
| * | PackWriter: Make want/have actual setsShawn O. Pearce2011-08-161-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During parsing these are used with contains(). If they are a List type, the contains operation is not efficient. Some callers such as UploadPack often pass a List here, so convert to Set when the type isn't efficient for contains(). Change-Id: If948ae3bf1f46e756bd2d5db14795e12ba7a6207 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | Use HEAD as default ref for RefLogCommand.Kevin Sawicki2011-08-171-6/+37
| |/ |/| | | | | | | | | | | This mirrors the default command-line behavior. Change-Id: I4f819410fa6df3064c560beb3184b61fd7bb1f15 Signed-off-by: Kevin Sawicki <kevin@github.com>
* | Adds DiffEntry.scan(TreeWalk, boolean) methodDariusz Luksza2011-08-171-0/+298
|/ | | | | | | | | | | | | | | Adds method into DiffEntry class that allows to specify whether changed trees are included in scanning result list. By default changed trees aren't added, but in some cases having changed tree would be useful. Also adds check for tree count in TreeWalk and when it is different from two it will thrown an IllegalArgumentException. This change is required by egit I7ddb21e7ff54333dd6d7ace3209bbcf83da2b219 Change-Id: I5a680a73e1cffa18ade3402cc86008f46c1da1f1 Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Add DiffCommand to JGit API"Christian Halstrick2011-08-161-0/+97
|\
| * Add DiffCommand to JGit APITomasz Zarna2011-08-161-0/+97
| | | | | | | | | | Bug: 334766 Change-Id: Iea74c599a956a058608e424d0274f879bc2f064a
* | Merge "Fix reading of ref names containing characters that sort before /"Robin Rosenberg2011-08-101-0/+30
|\ \ | |/ |/|
| * Fix reading of ref names containing characters that sort before /Robin Rosenberg2011-07-221-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A set of ref names like ('a/b' and 'a+b') would cause the RefDirectory to think that the set of refs have changed because it traversed the 'a' directory in the subtree before looking at 'a+b', but it then compared with the know refs which are sorted with 'a+b' first. Fix this by traversing the refs tree in another order. Treat a directory as if they ends with a '/' before deciding on the order to traverse the refs tree. Bug: 348834 Change-Id: I23377f8df00c7252bf27dbcfba5da193c5403917 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | Merge doesn't remove empty foldersTomasz Zarna2011-07-131-0/+41
| | | | | | | | | | Bug: 349848 Change-Id: I2aa5a1a7259889428e4845046b900538262f3c84
* | Add support for reseting on directoriesDariusz Luksza2011-07-121-3/+43
| | | | | | | | | | | | | | | | | | | | Reset command should works recursively and allows reset all changed files in given directory. Bug: 348524 Change-Id: I441db34f226be36548c61cef77958995971498de Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Fixed creation of branch from a tagSasa Zivkov2011-07-121-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Creation of a branch X from an annotated tag, as the starting point, resulted into .git/refs/heads/X containing the ID of the annotated tag instead of the ID of the tagged commit. This fix peels the tag ref before using it as the starting point for the newly created branch. Bug: 340836 Change-Id: I01c7325770ecb37f5bf8ddb2a22f802466524f24 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Cleanup directories leftover by test.Adrian Goerler2011-07-073-44/+0
| | | | | | | | | | | | | | Use the temporary file management from superclass. Change-Id: I3042951dc21860b4b85dd72a6bf41ee7cfe2aba4 Signed-off-by: Adrian Goerler <adrian.goerler@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Cloning should fail when destination directory exists and is not emptyAdrian Goerler2011-07-062-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to clone into a folder that already contains a cloned repository native git will fail with a message "fatal: destination path 'folder' already exists and is not an empty directory.". Now JGit will also fail in this situation throwing a JGitInternalException. The test case was provided by Tomasz Zarna. Bug: 347852 Change-Id: If9e9919a5f92d13cf038dc470c21ee5967322dac Also-by: Tomasz Zarna <Tomasz.Zarna@pl.ibm.com> Signed-off-by: Adrian Goerler <adrian.goerler@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Do not catch Exception in test casesStefan Lay2011-07-062-153/+115
| | | | | | | | | | | | | | Exception handling is already done by JUnit. Change-Id: Ia25d768c311d384d728f281aced92f598e5e2041 Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* | Merge "Add lookup to remote config if the refSpec is not explicitly set"Christian Halstrick2011-07-061-0/+72
|\ \
| * | Add lookup to remote config if the refSpec is not explicitly setStefan Lay2011-07-041-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | If no refSpec is explicitly set, the PushCommand should first check the remote config and then as a fallback use the current behavior. Change-Id: I2bc648abc517b1d01b2de15d383423ace2081e72 Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* | | TemporaryBuffer: Fix reading from in-memory InputStreamShawn O. Pearce2011-06-241-0/+15
|/ / | | | | | | | | | | | | | | I had the conditions wrong here, causing the in-memory InputStream to always appear to be at EOF. Change-Id: I6811d6187a34eaf1fd6c5002550d631decdfc391 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Add ReflogCommandChris Aniszczyk2011-06-221-0/+90
| | | | | | | | | | | | | | | | Adds a git-reflog command and associated tests. Bug: 347859 Change-Id: Iba146ac842cc9ca0be43d3381b4082c9e92bf56f Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Refactor out ReflogEntryChris Aniszczyk2011-06-202-14/+13
| | | | | | | | | | | | | | | | It's useful to have ReflogEntry refactored out so it can be used by clients via the JGit API. Change-Id: I03044df9af9f9547777545b7c9b93bdf5f8b7cb5 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* | Fix IndexOutOfBoundsException when parsing PersonIdentMarc Strapetz2011-06-141-0/+15
|/ | | | | | IndexOutOfBoundsException could occur when parsing PersonIdent for which no name is present, as part of a RevCommit (nameB > 0).
* Merge branch 'stable-1.0'Matthias Sohn2011-06-022-0/+414
|\ | | | | | | | | | | | | | | * 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
| * blame: Compute the origin of lines in a result fileShawn O. Pearce2011-05-312-0/+414
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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 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>