aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse
Commit message (Collapse)AuthorAgeFilesLines
* Add missing license header to modification times test.Markus Duft2012-06-111-0/+37
| | | | | | | This adds the header i forgot to add in I18047f5725f22811bb4194ca1d3a3cac56074183. Change-Id: I9160b0632c65da9e30a88688c4d9216b5f93d818
* Merge branch 'stable-2.0'Shawn O. Pearce2012-06-072-0/+97
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By Robin Rosenberg (6) and others via Gerrit Code Review @ Eclipse.org (2) and Matthias Sohn (1) * stable-2.0: Prepare next 2.0.0-SNAPSHOT builds JGit v2.0.0.201206060730-rc3 Remove Jetty p2 repository from Maven build Get rid of warnings about empty statments Removed unused parameters from private methods cleanup: Remove unused declarations Make FS OS X detection work for OpenJDK Use working tree iterator to compare file modes Further cleanup of exceptions in Git API Update build to use Tycho 0.15.0 Throw formal CheckoutConflictException on hard reset Configure maven-source-plugin execution in parent POM Support gitdir: refs in BaseRepositoryBuilder.findGitDir Relax RevisionSyntaxException to an IllegalArgumentException Change-Id: I05727693e0c9e762d4fc220ceadcd5a5bfb11d0d
| * Use working tree iterator to compare file modesKevin Sawicki2012-06-051-0/+40
| | | | | | | | | | | | | | | | | | | | Add isModeDifferent method to WorkingTreeIterator that compares mode with consideration of the core.filemode setting in the config. Bug: 379004 Change-Id: I07335300d787a69c3d1608242238991d5b5214ac Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
| * Support gitdir: refs in BaseRepositoryBuilder.findGitDirKevin Sawicki2012-06-041-0/+57
| | | | | | | | | | | | | | | | | | | | This allows findGitDir to be used for repositories containing a .git file with a gitdir: ref to the repository's directory such as submodule repositories that point to a folder under the parent repository's .git/modules folder Change-Id: I2f1ec7215a2208aa90511c065cadc7e816522f62 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | Make DirCacheCheckout update timestamps in the index.Markus Duft2012-06-061-0/+90
| | | | | | | | | | | | | | | | This updates the timestamp of files that are not touched during checkout. Otherwise the timestamp will always be zero, causing the IndexDiffFilter to always calculate the checksum of file contents. Change-Id: I18047f5725f22811bb4194ca1d3a3cac56074183
* | Merge changes Iee9af8d5,I8e1674f0,If5a6fcc5,I3bb28e4dShawn O. Pearce2012-06-051-1/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | * changes: Use BatchRefUpdate for tracking refs in FetchProcess Batch reference updates together for storage Expose ReceiveCommand.updateType to check for UPDATE_NONFASTFORWARD Reject non-fast-forwards earlier in BaseReceivePack
| * | Use BatchRefUpdate for tracking refs in FetchProcessShawn O. Pearce2012-05-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there are a lot of references to modify, using BatchRefUpdate can save time if the underlying storage is able to combine these updates together. This should speed up initial clone or fetch into an empty repository, as some projects can have hundreds of release tags, or hundreds of branch heads. Change-Id: Iee9af8d5fa19080077d88357c18853540936e940
* | | fix PackWriter excluded objects handlingChristian Halstrick2012-06-041-0/+66
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | PackWriter supports excluding objects from being written to the pack. You may specify a PackIndex which lists all those objects which should not go into the new pack. This feature was broken because not all commits have been checked whether they should be excluded or not. For other object types the exclude algorithm worked. This commit adds the missing check. Change-Id: Id0047098393641ccba784c58b8325175c22fcece Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "Only increment mod count if packed-refs file changes" into stable-2.0Shawn Pearce2012-06-041-0/+32
|\ \
| * | Only increment mod count if packed-refs file changesKevin Sawicki2012-05-281-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously if a packed-refs file was racily clean then there was a 2.5 second window in which each call to getPackedRefs would increment the mod count causing a RefsChangedEvent to be fired since the FileSnapshot would report the file as modified. If a RefsChangedListener called getRef/getRefs from the onRefsChanged method then a StackOverflowError could occur since the stack could be exhausted before the 2.5 second window expired and the packed-refs file would no longer report being modified. Now a SHA-1 is computed of the packed-refs file and the mod count is only incremented when the packed refs are successfully set and the id of the new packed-refs file does not match the id of the old packed-refs file. Change-Id: I8cab6e5929479ed748812b8598c7628370e79697
* | | Update ORIG_HEAD when resettingKevin Sawicki2012-05-312-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Write the old object id from the RefUpdate to the ORIG_HEAD file after the update completes. Add two new convenience methods to Repository to read and write the ORIG_HEAD reference similar to the methods for reading/writing CHERRY_PICK_HEAD and MERGE_HEAD. Bug: 375525 Change-Id: I120b3b2cd3b1ddae88fce435285bae15cbf96f5e
* | | Git API does not declare GitAPIException call() and related cleanupsRobin Rosenberg2012-05-3019-165/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All commands should throw a GitAPIException so new exceptions can be added without breaking the builds of old code, i.e. anyone that calls a Git API should catch GitAPIException and not just the currently known exceptions. Now the only checked exceptions on Git API calls are GitException and subclasses of it. New checked exceptions that are subclasses of GitException may be added without breaking the API. Javadoc for GitAPIException is declared on GitCommand and inherited to subclasses. JGitInternalException is not explicitly documented anymore. Unfortunately this change itself breaks the API. The intention is that it shall be possible to add new checked subclasses of GitAPIException without breaking the API. Bug: 366914 EGit-Change-Id: I50380f13fc82c22d0036f47c7859cc3a77e767c5 Change-Id: I50380f13fc82c22d0036f47c7859cc3a77e767c5 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Merge "Update smudged entries when writing index" into stable-2.0Robin Rosenberg2012-05-303-0/+188
|\ \ \
| * | | Update smudged entries when writing indexKevin Sawicki2012-05-283-0/+188
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overload DirCache.lock to take a repository that is used for updating smudged index entries with information from the repository's working tree. New unit tests are also added for updating smudged index entries on reset, checkout, and commit. Change-Id: I88689f26000e4e57e77931e5ace7c804d92af1b6
* / / Enable loading history until a given commitMatthias Sohn2012-05-301-0/+140
|/ / | | | | | | | | | | | | This is needed to allow jumping to a selected commit when loading history incrementally. Change-Id: Id3b97d88d3b4b2d67561b11f8810cb88fe040823 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* / Ensure resetting on commit idDariusz Luksza2012-05-231-0/+20
|/ | | | | | | | | When reset command was called with tag name as parameter the resulting HEAD was set to the tag's SHA-1 which is a bug. This patch ensures that repository.resolve() call always returns commit id. Change-Id: I219b898c620a75c497c8652dbf4735fd094c4d7c Signed-off-by: Dariusz Luksza <dariusz@luksza.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Move NLS test for HttpServerText to http.testShawn O. Pearce2012-05-221-6/+0
| | | | | | | This never should have been in the core library test suite, as that test suite never should depend upon the HTTP server module. Change-Id: Ie0528c4d1c755823303d138e327a3a2f4caccc32
* Smudge index entries on first write (too), as well when readingRobin Rosenberg2012-05-211-0/+22
| | | | | | | | | | | That happens when the index and a new file is created within the same second and becomes a problem if we then modify the newly created file within the same second after adding it to the index. Without smudging JGit will, on later reads, think the file is unchanged. The accompanying test passed with the smuding on read. Change-Id: I4dfecf5c93993ef690e7f0dddb3f3e6125daae15
* Make output stream optional in DiffCommandKevin Sawicki2012-05-101-0/+19
| | | | | | | | | | | | Use the NullOutputStream.INSTANCE value when the configured output stream is null or the command is configured to only show name and status. Also only set the context and prefix options if formatting is actually being performed. Bug: 377157 Change-Id: I333cfcc82ee746f3c6a8e94c09dcc803ffbb4b3a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Validate paths during DirCheckoutRobin Rosenberg2012-04-231-0/+420
| | | | | | | | | | | | | | | | | | | DirCacheCheckout and CanonicalTreeParser cooperate. CanonicalTreeParser can detect malformed, potentially malicious tree entries and sets a flag, while DirCacheCheckout refuses to work with such paths. Malicious tree entries are ".", "..", ".git" (case insensitive), any name containing '/' and (on Windows '\') and also (on Windows) any paths ending in a combination of '.' or space or containing a ':'. We also forbid all special names like "con" etc on Windows. Some of the test can execute on any platform by enabling partial platform emulation. A new runtime exception, InvalidPathException, is introduced. For backwards compatibility it extends InvalidArgumentException. Change-Id: I86199105814b63d4340e5de0e471d0da6b579ead Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enable large file supportRobin Rosenberg2012-04-181-0/+236
| | | | | | | | Allow adding files with size over 2 GB. The drawback is that the tests for huge file support adds roughly 10 minutes of execution time. For that reason we @Ignore the test in the standard test execution. Change-Id: I5788e8009899203b346f353297166825b3744575
* Allow to write tests with CLI syntaxTomasz Zarna2012-04-181-0/+102
| | | | | | | CQ: 6385 Bug: 365444 Change-Id: I2d5164cd92429673fe3c37e9f5f9bc565192cc12 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enable DirCacheEntry's copyMetaData to not copy stage infoRobin Rosenberg2012-04-171-0/+50
| | | | | | | When there is a conflict sometimes we did not set the stage of the conflict entries properly for the STAGE_1 entry. Change-Id: I1c28ff6251fdbc95f7c40fc3e401f1b41157a9f6
* Merge "Fix broken TagCommand API"Robin Rosenberg2012-04-064-35/+40
|\
| * Fix broken TagCommand APIRobin Rosenberg2012-04-064-35/+40
| | | | | | | | | | | | | | | | Tags can be un-annotated whereby there is no RevTag object, only a ref pointing to the tagged object. Bug: 360650 Change-Id: I06309c45c0a896fe2a0a874700febf78c9fb87e8
* | Merge "Handle content length in WorkingTreeIterator"Robin Rosenberg2012-04-051-38/+30
|\ \
| * | Handle content length in WorkingTreeIteratorRobin Rosenberg2012-03-271-38/+30
| |/ | | | | | | | | | | | | | | | | | | Content length is computed and cached (short term) in the working tree iterator when core.autocrlf is set. Hopefully this is a cleaner fix than my previous attempt to make autocrlf work. Change-Id: I1b6bbb643101a00db94e5514b5e2b069f338907a
* | Merge "Recurse into cloned submodules"Matthias Sohn2012-04-031-0/+87
|\ \
| * | Recurse into cloned submodulesKevin Sawicki2012-04-011-0/+87
| |/ | | | | | | | | | | | | | | Iterate over all successfully cloned submodules recursively and continue initializing and updating until no more are found. Bug: 375426 Change-Id: Ifb99e41e2deb0c369442bca3c0f5f072dd006816
* / Index config section and subsection names in one passShawn O. Pearce2012-04-021-1/+1
|/ | | | | | | | | | Instead of indexing the subsection names on each request for a given section name, index both the section and subsection names in a single scan through the entry list. This should improve lookup time for reading the section names out of the configuration, especially for the url.*.insteadof type of processing performed in RemoteConfig. Change-Id: I7b3269565b1308f69d20dc3f3fe917aea00f8a73
* Revert "Allow to write tests with CLI syntax"Matthias Sohn2012-03-231-102/+0
| | | | | | | | | This reverts commit bf845c126d53f07de103e03b68ddb7f24014cee5 since this change needs to go through a formal IP review and Chris missed to file a CQ for that. Change-Id: I303515d78116f0591a2911dbfb9f857738f086a9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Allow to write tests with CLI syntax"Christian Halstrick2012-03-221-0/+102
|\
| * Allow to write tests with CLI syntaxTomasz Zarna2012-03-221-0/+102
| | | | | | | | | | Bug: 365444 Change-Id: I86f382913bc47665c5b9a2827b878e7dbedce7b1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add command support for dropping a stashed commitKevin Sawicki2012-03-211-0/+298
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This extracts the logic for writing to the reflog from RefDirectory into a new ReflogWriter class. This class creates a public API for writing reflog entries similar to ReflogReader for reading reflog entries. The new command supports rewriting the stash's log to remove a configured entry followed by updating the stash ref to the value at the bottom of the newly written log. Change-Id: Icfcbc70e838666769a742a94196eb8dc9c7efcc7 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | Ignore trailing comments in transport SPI parsingKevin Sawicki2012-03-212-0/+114
| | | | | | | | | | | | | | | | | | | | Check for a '#' character in each line read and parse the leading characters as the class name of a TransportProtocol being registered via SPI. Bug: 373439 Change-Id: If36cb62c07ecea78ba0f326a87edf1d80b7b42b6 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | Compare repository format version as parsed longKevin Sawicki2012-03-212-3/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows repositoryies with a missing repositoryformatversion config value to be successfully opened but still throws exceptions when the value is a non-long or greater than zero. git-core attempts to parse this config value as a long as well and defaults to 0 if the value is missing. Bug: 368697 Change-Id: I4a93117afca37e591e8e0ab4d2f2eef4273f0cc9 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | Copy all branch configuration values when renamingKevin Sawicki2012-03-211-0/+172
|/ | | | | | | | | | Previously only certain values were copied over which caused divergence in behavior between the JGit command and corresponding CGit command. Bug: 372051 Change-Id: I72a83215a679a713138da31f5ab838f14388d4bd Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* LogCommand#setMaxCount affects all commitsTomasz Zarna2012-03-181-4/+32
| | | | | | | Bug: 370132 Change-Id: I9f5ff3640a4f69c0b48c97609728d7672e63e6ab Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Revert "Quickfix for AutoCRLF handling"Shawn O. Pearce2012-03-151-30/+1
| | | | | | | | | | | This reverts commit 88fe2836edab8d8ce82d28acd9d07b061988ff3a. Auto CRLF isn't special enough to be screwing around with the buffers used for raw byte processing of the ObjectInserter API. If it needs a buffer to process a file that is bigger than the buffer allocated by an ObjectInserter, it needs to do its own buffer management. Change-Id: Ida4aaa80d0f9f78035f3d2a9ebdde904c980f89a
* Only unstash files changed when originally stashedKevin Sawicki2012-03-131-0/+110
| | | | | | | | | | | | | | | | | | | Previously a DirCacheCheckout was done using a merge tree reflecting the state of the repository when the stash was originally done. This was wrong since unstashing after making subsequent commits would undo changes already committed by checking out entries from an outdated tree. The new approach is to scan for conflicts initially using a 6-way tree walk that contains the trees for the stashed HEAD, stashed index, stashed working directory, current HEAD, current index, and current working directory. Then perform a subsequent scan of the stashed HEAD, index, and working directory trees and apply all the stashed differences to the current index and working directory. Bug: 372882 Change-Id: Ica65f162132c00a16964e838de66fc8b5cd0b0aa Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Move JGitText to an internal packageRobin Rosenberg2012-03-1210-10/+10
| | | | Change-Id: I763590a45d75f00a09097ab6f89581a3bbd3c797
* Merge changes Ic0ee9c08,Ia3e82682,I8d8ab547,I8f2cd0a0,I45823b0c,Ie22ac47eShawn Pearce2012-03-121-10/+8
|\ | | | | | | | | | | | | | | | | | | * changes: cleanup: Silence an unused-parameter warning cleanup: Get rid of some unused-warnings cleanup: Remove unused parameter in ConsoleCredentialsProvider cleanup: Drop unused parameter on DhtPackParser cleanup: Remove unneeded parameter to private method in RefUpdateTest cleanup: Remove unnecessary @SuppressWarnings
| * cleanup: Remove unneeded parameter to private method in RefUpdateTestRobin Rosenberg2012-03-091-10/+8
| | | | | | | | Change-Id: I45823b0c1ad5d249d539d7c8e1180ad7432abb3e
* | Keep submodules in index that are missing in working directoryKevin Sawicki2012-03-101-0/+37
| | | | | | | | | | | | | | | | | | | | | | Submodules present in the index but missing from the working directory should not be staged for deletion when AddCommand is called with the update flag set to true. This mirrors the behavior of CGit. Submodules can still be staged for deletion by running by using the RmCommand. Change-Id: Iee508a67f9621269d1c28d422f88c6b8dd9f8e6e
* | Merge "EolCanonicalizingInputStream: binary detection should be optional"Robin Rosenberg2012-03-091-8/+19
|\ \
| * | EolCanonicalizingInputStream: binary detection should be optionalMarc Strapetz2012-02-211-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | EolCanonicalizingInputStream may also be used in combination with .gitattributes. If .gitattributes states that a file is of type text, line endings have to be canonicalized even if the actual file content seems to be binary. Change-Id: Ie4ccdfc5cb91fbd55e06f51146cf5c7c84b8e18b
* | | Fix rebase > continue when nothing left to commit.Markus Duft2012-03-091-2/+58
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | If after resolving all conflicts nothing is left to commit, return an according result, so that downstreams (EGit, ...) can behave like cgit, and display a nice message informing the user. Currently, EGit displays a "HEAD advanced fast forward" message, which is absolutely not helpful at all. This is the basic API revamping required to get that state communicated to the outside world (EGit). Bug: 336812 Change-Id: If2665005cf54a5b51c0fe80bad019fa42b0205af
* | Remove ambiguous CheckoutConflictExceptionTomasz Zarna2012-03-062-4/+5
| | | | | | | | | | | | | | | | | | Checkout command should throw o.e.j.api.errors.CheckoutConflictException which is a GitAPIException not o.e.j.errors.CheckoutConflictException. PullCommand should rethrow the API exception as a JGitInternalException. Bug: 356922 Change-Id: I865c4905997d9834c85a97fbe7287604daf99075 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Reuse Git object created in setUpKevin Sawicki2012-03-051-9/+9
| | | | | | | | | | | | | | | | Removes unneeded calls to Git.wrap in test cases where a valid Git object already exists as an instance variable. Change-Id: Id0e032d7886dfa6a3288321503a02743413f707d Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* | Set person and message on stash ref updateKevin Sawicki2012-03-051-0/+23
| | | | | | | | | | | | | | | | | | This will be the message and person used for the commit of stashed working directory changes. Bug: 372884 Change-Id: I2501b080f6b94e826cf7dba3fd526ae5c1d969d1 Signed-off-by: Chris Aniszczyk <zx@twitter.com>