summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Work around smart HTTP bugs in C GitShawn O. Pearce2012-06-279-4/+353
| | | | | | | | | | | | | | | I have unfortunately introduced a few bugs in the native Git client over the years. 1.7.5 is unable to send chunked requests correctly, resulting in corrupt data at the server. Ban this client whenever it uses chunked encoding with an error message. Prior to some more recent versions, git push over HTTP failed to report status information and error messages due to a race within the client and its helper process. Check for these bad versions and send errors as messages before the status report, enabling users to see the failures on their terminal. Change-Id: Ic62d6591cbd851d21dbb3e9b023d655eaecb0624
* Make InMemoryRepository pack names globally uniqueDave Borowitz2012-06-271-1/+2
| | | | | | | | | | | | | | | It was easy to create multiple packs with exactly the same name and same DfsRepositoryDescription in a test, which can poison the DfsBlockCache. The javadoc for DfsObjDatabase.newPack() explicitly says pack names should be unique within an entire DFS, so do this by making the packId AtomicInteger static. Arguably, test writers shouldn't be doing things like putting 'new DfsRepositoryDescription("test")' in a setUp() method, but that's a natural thing to do, and we don't document this restriction anywhere. Change-Id: I9477413ab3950d83b7d17e173fbc0a3e064896e3
* Merge "Disable PackParser EOF check if more data expected"Shawn Pearce2012-06-271-1/+2
|\
| * Disable PackParser EOF check if more data expectedIan Wetherbee2012-06-261-1/+2
| | | | | | | | | | | | | | | | The PackParser EOF check is incompatible with the expect data after pack footer flag, so turn off the EOF check if the expecting data flag is true. Change-Id: I697ebd9e1d1eed765d00aecaef955cf978cfd0b9
* | Use the working tree's .gitmodules in SubmoduleWalk.forIndex()Dave Borowitz2012-06-252-22/+12
| | | | | | | | | | | | | | This was broken in fe1f1b8f8aba60fdd1ad6f0f72e9c9180978cc60, which preferred the index over the working tree when both were present. Change-Id: I97dcf9a088adcbd0187fa7eec9ef34445ce3a981 Signed-off-by: Kevin Sawicki <kevin@github.com>
* | Merge changes I6b2ce96b,I499f518fChristian Halstrick2012-06-253-10/+160
|\ \ | | | | | | | | | | | | | | | * changes: Fix order of deletion for files/dirs in ResolveMerger Don't return success on failing paths in ResolveMerger
| * | Fix order of deletion for files/dirs in ResolveMergerRobin Stocker2012-06-232-9/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, the paths to delete were stored in a HashMap, which doesn't have a particular order. So when e.g. both the file "a/b" and the directory "a" were to be deleted, it would sometimes try to delete "a" first. This resulted in a failed path because File#delete() fails when a directory isn't empty. With this change, an ArrayList is used for storing the paths to delete. The list contains the paths in a top-down order, as defined by the order of processEntry. When the files are deleted, the list is iterated in reverse, ensuring that all files of a directory are deleted before the directory itself. Bug: 354099 Change-Id: I6b2ce96b3932ca84ecdfbeab457ce823c95433fb Signed-off-by: Robin Stocker <robin@nibor.org>
| * | Don't return success on failing paths in ResolveMergerRobin Stocker2012-06-232-1/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ResolveMerger#mergeImpl() was only returning false (= failed) when there were unmerged paths. In the case when there were only failing paths, it returned true. Because MergeCommand looks at the return value for determining if the merge failed, it would fall into the successful case there, where it should instead return a MergeResult with MergeStatus.FAILED. This change adds a test case for this and makes the ResolveMerger return false when there are failing paths. This was discovered while working on fixing bug 354099 and is needed for its test case. Bug: 354099 Change-Id: I499f518f6289ef93e017db924b2aa857f2154707 Signed-off-by: Robin Stocker <robin@nibor.org>
* | | Add toString() to simplify debugging rebase stepsMatthias Sohn2012-06-241-0/+14
| | | | | | | | | | | | Change-Id: Id1508c5f007a6a6680928992a1c7524c266a9ce4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Ignore empty lines when parsing git-rebase-todoRobin Stocker2012-06-232-5/+27
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When starting a rebase with C Git, there may be empty lines in the git-rebase-todo file. Before this change, JGit would fail to parse the file with e.g. the following exception: JGitInternalException: Unknown or unsupported command " #", only "pick" is allowed. This happened when there was an empty line just before the comments, because the nextSpace would be the one from the comment. Now the empty lines are ignored by checking for nextSpace < ptr outside of the loop. Change-Id: I94ad299f367c846e7729c74f49c6b8f93f75ae81 Signed-off-by: Robin Stocker <robin@nibor.org>
* | Merge "Serve 403 from RepositoryFilter on ServiceMayNotContinueException"Shawn Pearce2012-06-211-1/+1
|\ \
| * | Serve 403 from RepositoryFilter on ServiceMayNotContinueExceptionDave Borowitz2012-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has no effect on Git clients, but for browsers, 403 Forbidden may be more appropriate. 500 Internal Server Error implies that there is a problem with the server, whereas ServiceMayNotContinueException is specifically intended to cover cases where the server is functioning correctly but has determined that the request may not proceed. Change-Id: I825abd2a029d372060103655eabf488a0547c1e8
* | | Make clear method on StoredConfig publicRobin Rosenberg2012-06-211-0/+5
| |/ |/| | | | | | | | | EGit needs this to be able to revert unsaved changes. Change-Id: I50cc8056aaff47fef6080970866962e3eb634e29 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "Fix boxing warnings in org.eclipse.jgit.lib.ConfigTest"Shawn Pearce2012-06-181-4/+4
|\ \
| * | Fix boxing warnings in org.eclipse.jgit.lib.ConfigTestTomasz Zarna2012-06-181-4/+4
| | | | | | | | | | | | Change-Id: Ie6ae7ade36a117c22c656f792266d4116d52b9bc
* | | Merge "Refactor TransportHttp for long-polling"Shawn Pearce2012-06-161-92/+139
|\ \ \
| * | | Refactor TransportHttp for long-pollingIan Wetherbee2012-06-151-92/+139
| | |/ | |/| | | | | | | | | | | | | | | | Split Service into MultiRequestService (fetch, push) and LongPollService (upcoming publish-subscribe). Change-Id: Ice373d3dee63c395490d2707473ccf20a022e5cf
* | | Merge "ReceivePack supports InputStream data after pack"Shawn Pearce2012-06-165-9/+203
|\ \ \
| * | | ReceivePack supports InputStream data after packIan Wetherbee2012-06-155-9/+203
| |/ / | | | | | | | | | | | | | | | | | | When receiving a pack, data buffered after the pack can restored to the InputStream if the stream supports mark and reset. Change-Id: If04915c32c91be28db8df7e8491ed3e9fe0e1608
* | | In org.eclipse.jgit.pgm.ConfigTest expect core.filemode=false on WindowsTomasz Zarna2012-06-161-8/+10
| | | | | | | | | | | | Change-Id: I8f8ae7a8bc0793643184bc0e7afa9f4e2c5ff1a1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Fix resource leaks due to unclosed repositoriesChristian Halstrick2012-06-1613-64/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever a call to JGit returns a Repository the caller should make sure to call close() on it if he doesn't need it anymore. Since instances of Repository contain e.g. open FileOutputStreams (for pack files) forgetting to close the repository can lead to resource leaks. This was the reason why dozens of the JUnit tests failed on Windows with "Can't delete file ...." errors. In LocalDiskRepositoryTestCase.tearDown() we tried to delete the repositories we used during tests which failed because we had open FileOutputStreams. Not only the obvious cases during Clone or Init operations returned Repositories, but also the new SubModule API created repository instances. In some places we even forgot to close submodule repositories in our internal coding. To see the effects of this fix run the JGit JUnit tests under Windows. On other platforms it's harder to see because either the leaking resources don't lead to failing JUnit tests (on Unix you can delete files with open FileOutputStreams) or the java gc runs differently and cleans up the resources earlier. Change-Id: I6d4f637b0d4af20ff4d501db091548696373a58a Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | Fix LockFileTest on WindowsChristian Halstrick2012-06-161-2/+3
|/ / | | | | | | | | | | | | | | | | | | LockFileTest was failing on Windows because we couldn't delete the lock file of the index. The reason was that a LockFile instance still had an open handle to the lock file preventing us to delete the file (in contrast to the behavior on other platforms). Change-Id: I1d50442b7eb8a27f98f69ad77c5e24a9698a7b66 Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Read .gitmodules config from the tree in SubmoduleWalkDave Borowitz2012-06-154-7/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | It is not always appropriate to use the .gitmodules file from the working tree, for example if reading the modules at a specific commit. And sometimes it is impossible, as in a bare repository. When using the static factory methods, automatically set up the appropriate root tree so lazy loading of the config file reads from the appropriate place. Leave the current behavior of looking in the working tree as a fallback for the case where walking the index. Change-Id: I71b7ed3ba16c80b0adb8c5fd85b5c37fd4aef8eb
* | Add a CommitBuilder method to edit arbitrary DirCacheEntrysDave Borowitz2012-06-151-2/+6
| | | | | | | | Change-Id: Ic2f5ec28621219a8ff1272674e2bf2c8d36eb107
* | Add a release() method to SubmoduleWalkDave Borowitz2012-06-151-12/+29
|/ | | | | | | | We need a way to release the underlying TreeWalk. Also, use this method to release walks from the static factory methods on error or when submodules are not found. Change-Id: I6bedc2db78bcd577aef2cfe6715bb981a26dcfd7
* Add "--squash" option to MergeCommandTomasz Zarna2012-06-1517-60/+765
| | | | | | | CQ: 6570 Bug: 351806 Change-Id: I5e47810376419264ecf4247b5a333af5c8945080 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove unused import of ObjectInserter in ResolveMergerTomasz Zarna2012-06-151-2/+1
| | | | Change-Id: I415894418f6fbe922c61294b21e15eee64e8a806
* Merge "Add Transport URI constructor without a repository"Shawn Pearce2012-06-156-0/+91
|\
| * Add Transport URI constructor without a repositoryIan Wetherbee2012-06-146-0/+91
| | | | | | | | | | | | | | Let a Transport instance be opened with only a URI, for use in the upcoming publish-subscribe feature. Change-Id: I391c60c10d034b5c1c0ef19b1f24a9ba76b17bb5
* | Merge "Fix UnionInputStream.read to be more Java-like"Shawn Pearce2012-06-152-13/+31
|\ \
| * | Fix UnionInputStream.read to be more Java-likeIan Wetherbee2012-06-142-13/+31
| |/ | | | | | | | | | | | | | | | | Relax the read() method to not block until exactly "len" bytes have been read. Instead, return when one or more bytes have been read, up to "len", so UnionInputStream more closely resembles InputStream's read() method. Change-Id: I3f632be8eb85a4a0baf27c9f067c8d817162de2b
* | Use only a single ObjectInserter in ResolveMergerShawn O. Pearce2012-06-141-5/+3
| | | | | | | | | | | | | | | | The base class supplies an ObjectInserter to its implementations by way of the getObjectInserter method. Tracking a second inserter instance doesn't match with the expected behavior. Change-Id: I78996bd06ef9028c8aa2e4e192ff647c43da847d
* | Define ObjectInserter.Filter to wrap another ObjectInserterShawn O. Pearce2012-06-141-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | Filter supports wrapping another ObjectInserter. By default all methods are delegated to the wrapped inserter. Implementors may override methods selectively for altered behavior. The instance that is wrapped may be determined dynamically by code, supporting lazy allocation of the delegate, or other patterns like object pooling. Change-Id: I7b2613d09e73f94e675bad33afbb693f6a7f3df6
* | Allow applications to pass ObjectInserter to MergerShawn O. Pearce2012-06-141-0/+19
|/ | | | | | | | | Gerrit Code Review needs to control which inserter is used by a Merger. Allow the application to set the inserter before calling merge, giving callers more direct control over how objects will be created. Change-Id: I3c527a493db4659e95289ff3077cffb9e32336cf
* Prepare 2.1.0 buildsMatthias Sohn2012-06-1447-262/+262
| | | | Change-Id: I4aad3efdd435d8d5eb53c84a8d38132acce97c25 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge branch 'stable-2.0'Matthias Sohn2012-06-1432-9/+1070
|\ | | | | | | | | | | | | | | | | | | | | * stable-2.0: Prepare post v2.0.0.201206130900-r builds JGit v2.0.0.201206130900-r Add org.eclipse.jgit.pgm.feature to enable consumption via p2 Do not set core.autocrlf when creating repo Change-Id: Ifdd71a6bc14d9c79f4433ebc3b53bf0042a4d4c8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Prepare post v2.0.0.201206130900-r buildsMatthias Sohn2012-06-1447-47/+47
| | | | | | | | Change-Id: I51b1bbed35288c5285b3d6860efba97d58de5a1c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * JGit v2.0.0.201206130900-rv2.0.0.201206130900-rMatthias Sohn2012-06-1347-48/+48
| | | | | | | | | | Change-Id: I685e09b3e37d68614df1b5cc5f687a65cd6eb82d Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Add org.eclipse.jgit.pgm.feature to enable consumption via p2Matthias Sohn2012-06-1230-0/+1062
| | | | | | | | | | | | | | | | | | | | Orion wants to consume the pgm bundle from a p2 repository in their build. Also add corresponding source bundle and feature to provision sources via a target platform. Bug: 373789 Change-Id: I0016ee155553c546606b63d310666eb10bd997e1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Do not set core.autocrlf when creating repoRobin Rosenberg2012-06-122-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | core.autorlf defaults to false, but can be set in the user or "system" config files. Note that EGit/JGit may not know where the "system" config file is located. Also fix pgm's ConfigTest which depends on default repository configuration. Bug: 382067 Change-Id: I2c698a76e30d968e7f351b4f5a2195f0b124f62f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Fix GitDateFormatter javadoc.Tomasz Zarna2012-06-141-1/+3
| | | | | | | | Change-Id: I627bdc387754a626ed8b1839494c05dfd5950d11 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | 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 changes I1c87fea9,I7bd5011f,Ie800c557Shawn Pearce2012-06-083-6/+238
|\ \ | | | | | | | | | | | | | | | | | | * changes: Add MetaFilter.serveRegex(Pattern) Expand RegexPipeline documentation Add simple tests for RegexPipeline
| * | Add MetaFilter.serveRegex(Pattern)Dave Borowitz2012-06-082-0/+16
| | | | | | | | | | | | | | | | | | | | | This allows the use of precompiled patterns, such as those compiled with flags. Change-Id: I1c87fea98e246004aecbae3aabaf1d21fbf3176e
| * | Expand RegexPipeline documentationDave Borowitz2012-06-081-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Include some behaviors that were not clear to me until I had used it a few times. Warn about broken behavior for capture groups that do not match. It would be nice to support these, but even for the cases where it's clear what the behavior should be, it would be infeasible to implement. For example, consider the second group of the regex "(/a)/b(/c)?" matched against the path "/a/b". We might want getServletPath() to return "/a/b" and getPathInfo() to return null, but this is hard to implement: there's no easy way to say "the substring up to the point where (/c) would have matched if it were in the string even though it's not." And even if we could, it's not clear there is even a right answer in the general case. Moreover, ideally we could warn about such broken patterns at servlet initialization time, rather than at runtime, but even answering the question of whether there are capture groups that might not match requires more customized regular expression parsing than we want to embark on. Hence, the best we can do is document how it fails. Change-Id: I7bd5011f5bd387f9345a0e79b22a4d7ed918a190
| * | Add simple tests for RegexPipelineDave Borowitz2012-06-081-0/+209
| | | | | | | | | | | | Change-Id: Ie800c55702ea9724b393be0a8b36e0e4da1a6e0d
* | | Merge branch 'stable-2.0'Shawn O. Pearce2012-06-0739-188/+351
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | Prepare next 2.0.0-SNAPSHOT buildsMatthias Sohn2012-06-0642-47/+47
| | | | | | | | | | | | Change-Id: I0d55b390502b3da139ab0d15a6cf3d05774d8ad9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v2.0.0.201206060730-rc3v2.0.0.201206060730-rc3Matthias Sohn2012-06-0642-47/+47
| | | | | | | | | | | | | | | Change-Id: I12f8800b74228e71c77f0fb82c250c154d06369f Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Merge "Use working tree iterator to compare file modes" into stable-2.0Christian Halstrick2012-06-063-24/+81
| |\ \