aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix FIXUP error for blank lines in interactive rebaseStefan Lay2013-11-221-1/+1
| | | | | | | | Empty lines of discarded commit messages were added to the commit message because they were not commented out properly. Bug: 422246 Change-Id: I263e8a6b30a3392d8b4f09c0695505068a0a485d Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* Fix parsing Rebase todo lines when commit message is missingStefan Lay2013-11-211-0/+2
| | | | | Bug: 422253 Change-Id: I9739b16c91d2df31a481360a712d3479a4eeee2e Signed-off-by: Stefan Lay <stefan.lay@sap.com>
* Add close() method to APIChristian Halstrick2013-11-201-0/+20
| | | | | | | | | | | The API in org.eclipse.jgit.api does allow to open repositories but it did not allow to close them. This commit fixes this and allows API users to close a repository without having to use lower-level classes. Bug: 420502 Change-Id: I866225cc8534ae5916113fa24eb1c7513fd4472e Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "Don't delete .idx file if .pack file can't be deleted"Robin Rosenberg2013-11-171-18/+39
|\
| * Don't delete .idx file if .pack file can't be deletedChristian Halstrick2013-11-131-18/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If during an garbage collection old packfiles are deleted it could happen that on certain platforms the index file can be deleted but the packfile can't be deleted (because someone locked the file). This led to repositories with packfiles without corresponding index files. Those zombie-packfiles potentially consume a lot of space on disk and it is never tried to delete them again. Try to avoid this situation by deleting packfiles first and don't try to delete the other files if we can't delete the packfile. This gives us the chance to delete the packfile during next GC. This commit only improves the situation - there is still the chance for orphan files during packfile deletion. We don't have an atomic delete of multiple files . Change-Id: I0a19ae630186f07d0cc7fe9df246fa1cedeca8f6
* | Document that path parameters should use '/' as separatorRobin Stocker2013-11-1514-22/+36
| | | | | | | | | | | | Bug: 421600 Change-Id: I505d994518aa608aaa797252433b6c97e2def5b4 Signed-off-by: Robin Stocker <robin@nibor.org>
* | Improve Javadoc for typeHint parameterRobin Stocker2013-11-143-15/+17
| | | | | | | | | | | | | | Link to an example type constant. Change-Id: I214ab834fa02901a38e6048a94a5224b30c5d93f Signed-off-by: Robin Stocker <robin@nibor.org>
* | Do not update the ref hot bit when checking isIndexLoadedColby Ranger2013-11-132-1/+5
| | | | | | | | | | | | | | | | | | | | DfsPackFile.isIndexLoaded() uses the DfsBlockCache.Ref.get() method to check if the index loaded. However, using the get() method marks a hot bit in the cache, which can cause the index to never be unloaded and seem hotter than it really is. Add a has() method which only checks if the value is not null and does not update the hot bit. Change-Id: I7e9ed216f6e273e8f5d79ae573973197654419b4
* | Add missing @since tagsMatthias Sohn2013-11-097-0/+14
|/ | | | Change-Id: Ic4fabec818d6fe336d3256ddc95934271272914a Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Interactive Rebase: Do actions if there were conflictsStefan Lay2013-11-081-80/+117
| | | | | | | | | If a commit was marked for edit, reword, squash or fixup, but the interactive rebase stopped because of a conflict, the step was not done after conflict resolution. This is done now. Change-Id: If8e7ccc50469165744f2b8a53d180f9ba0f72330 Signed-off-by: Stefan Lay <stefan.lay@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Rebase interactive should finish if last step is editStefan Lay2013-11-061-9/+14
| | | | | | | | When the last step was an edit step, rebase interactive did not finish after continuing the rebase. Instead, it returned with the status FAST_FORWARD. Change-Id: Ib19857474ac089dfeaae665ad5e95c66c21099b0
* Merge changes I40f2311c,I3c419094Matthias Sohn2013-11-055-10/+280
|\ | | | | | | | | | | * changes: Add additional RebaseResult for editing commits Add Squash/Fixup support for rebase interactive in RebaseCommand
| * Add additional RebaseResult for editing commitsStefan Lay2013-11-052-8/+19
| | | | | | | | | | | | | | | | | | With the new RebaseResult.EDIT a client can now distinguish if rebase stopped due to a conflict or because the commit was marked for edit in an interactive rebase. Change-Id: I40f2311cf43ed5f290dcda65a7bd85ba770a85f5 Signed-off-by: Stefan Lay <stefan.lay@sap.com>
| * Add Squash/Fixup support for rebase interactive in RebaseCommandTobias Pfeifer2013-11-054-2/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rebase command now supports squash and fixup. Both actions are not allowed as the first step of the rebase. In JGit, before any rebase step is performed, the next commit is already cherry-picked. This commit keeps that behaviour. In case of squash or fixup a soft reset to the parent is perfomed afterwards. CQ: 7684 Bug: 396510 Change-Id: I3c4190940b4d7f19860e223d647fc78705e57203 Signed-off-by: Tobias Pfeifer <to.pfeifer@web.de> Signed-off-by: Stefan Lay <stefan.lay@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge changes ↵Shawn Pearce2013-11-057-49/+200
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | I85470d1d,I43711486,Ie6ade781,Ic9ab2b6e,Iebe50933,Id6fac253,Ia6becf30,I2af8b0ac * changes: Use absolute paths for file:// URIs in tests Use getPath() in FileResolverTest Extract protocol constants to a common class Move repeat() to utility class for tests Remove hardcoded target/trash from test cases Remove dependency on StatusCommandTest Remove dependency on DiffFormatterReflowTest Remove unnecessary import of BaseConnection in MessageWriter
| * Extract protocol constants to a common classShawn Pearce2013-11-016-47/+199
| | | | | | | | | | | | This avoids the server from referencing the client code directly. Change-Id: Ie6ade781b5a689646ad8b0b2988ef2b544412195
| * Remove unnecessary import of BaseConnection in MessageWriterShawn Pearce2013-11-011-2/+1
| | | | | | | | Change-Id: I2af8b0ac0f9fbf2814eca23990ae527baf040539
* | Merge "testMaliciousPathEmpty fails on Windows"Christian Halstrick2013-11-041-2/+3
|\ \
| * | testMaliciousPathEmpty fails on WindowsRobin Rosenberg2013-11-011-2/+3
| |/ | | | | | | | | | | | | | | Checking of spaces at the end of the file name caused the test to fail for Windows only. Bug: 396662 Change-Id: I47bcccb0fa32ce606276c3f30d454851d115ca11 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | Enable to prepare interactive rebase and then start it explicitlyTobias Pfeifer2013-11-012-2/+56
| | | | | | | | | | | | | | | | | | Add Operation.PROCESS_STEPS to RebaseCommand to enable starting interactive rebase explicitly after rebase steps have been configured. Change-Id: I2d6f0de82010ea6523fbce6fb4501e847bdcdddc Signed-off-by: Tobias Pfeifer <to.pfeifer@web.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Parse commitId and shortMessage of a commented out line in rebase todoTobias Pfeifer2013-10-311-44/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | A rebase todo file consists of regular non-comment action lines and comment lines. In case that a regular action line has been commented out (i.e. prefixed with a hash '#'), the RebaseTodoLine that is representing this line should hold the values for commitId and shortMessage even though it's a comment line. This allows to switch between comment and non-comment easily even after the file has been persisted and reread. Change-Id: I56ec2ba08eaf3772e2d74d937dd496209a744d4b Signed-off-by: Tobias Pfeifer <to.pfeifer@web.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Enhance reading of git-rebase-todo formatted filesChristian Halstrick2013-10-315-264/+538
|/ | | | | | | | | | | | | | | | | | | | Reading and writing files formatted like the git-rebase-todo files was hidden in the RebaseCommand. Certain constructs (like leading tabs and spaces) have not been handled as in native git. Also the upcoming rebase interactive feature in EGit needs reading/writing these files independently from a RebaseCommand. Therefore reading and writing those files has been moved to the Repository class. RebaseCommand gets smaller because of that and doesn't have to deal with reading/writing files. Additional tests for empty todo-list files, or files containing comments have been added. Change-Id: I323f3619952fecdf28ddf50139a88e0bea34f5ba Signed-off-by: Christian Halstrick <christian.halstrick@sap.com> Also-by: Tobias Pfeifer <to.pfeifer@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Support extension of TransportHttpMichael Nelson2013-10-261-1/+10
| | | | | | | | | | This allows subclasses to configure the HTTP connection (for example, to add headers to the request). Bug: 400724 Change-Id: I6f9d699e158a7b9d813c8fa8d273992a28994e41 Signed-off-by: Michael Nelson <michael.nelson@tasktop.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Add / fix @since tagsMatthias Sohn2013-10-243-2/+4
| | | | Change-Id: I1e5bea968b3c79df4f600b75fde5b547ebadde36 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Make sure SystemReader is reset after test is runRobin Stocker2013-10-221-1/+2
| | | | | | | | Otherwise the MockSystemReader from the test setup is active for other tests. Change-Id: I7caf693bd692d06936e29efd4dc4aabb48c1c39b Signed-off-by: Robin Stocker <robin@nibor.org>
* Describe HEAD if no explicit target was setMatthias Sohn2013-10-112-8/+10
| | | | | Change-Id: I5a5a238709df813ec07278bb3b4f9ea5c85c0883 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Allow to set target of DescribeCommandMatthias Sohn2013-10-111-2/+3
| | | | Change-Id: I04805ce20cc203f5e491406c39b71e7017553b37 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix ServiceMayNotContinueException constructors for Java 1.5Colby Ranger2013-10-081-2/+3
| | | | | | | | | | IOException did not add a (String, Throwable) constructor until 1.5. Instead use the String super constructor and initCause to initialize the exception. Fixes bug 418889 Change-Id: Ide735ecfc7d04884981b79b57a4275863ce17006
* Add constructors that take Throwable to ServiceMayNotContinueException.Colby Ranger2013-10-071-0/+23
| | | | | | | | | ServiceMayNotContinueException usually wraps an underlying exception. Add convenience constructors that take Throwable. In the case a string is not provided, the message defaults to "internal server error", since it may be reported to the client. Change-Id: I15dc20306826c352f69e88afb7ed6927c12b6c1f
* Propagate IOException where possible when getting refs.Colby Ranger2013-10-0710-13/+48
| | | | | | | | | | Currently, Repository.getAllRefs() and Repository.getTags() silently ignores an IOException and instead returns an empty map. Repository is a public API and as such cannot be changed until the next major revision change. Where possible, update the internal jgit APIs to use the RefDatabase directly, since it propagates the error. Change-Id: I4e4537d8bd0fa772f388262684c5c4ca1929dc4c
* Merge branch 'stable-3.1'Matthias Sohn2013-10-033-5/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-3.1: Prepare post 3.1.0 builds JGit v3.1.0.201310021548-r Fix order of commits in rebase todo file header Prepare post 3.1.0 RC1 builds JGit v3.1.0.201309270735-rc1 Attempt to fix graph layout when new heads are introduced Prepare re-signing pgm's ueberjar to avoid SecurityException Use full branch name when getting ref in BranchTrackingStatus Change-Id: Ida30175d0c058048cbe4b563aae7f85cd008db29 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Fix order of commits in rebase todo file headerStefan Lay2013-09-291-2/+2
| | | | | | | | Change-Id: I0e41d89bbd4fc01ad3b3d05a45ee60af853bfae7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * Attempt to fix graph layout when new heads are introducedRobin Rosenberg2013-09-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | Sometime the new commit is no allocated onto a new lane leading to the commit being drawn on the wrong branch and something that looks like a merge. The drawback is that this also changes existing valid graphs. Bug: 368927 Change-Id: Ic8a8247c8a53be802c1be83850ed766b902ca646
| * Use full branch name when getting ref in BranchTrackingStatusRobin Stocker2013-09-201-2/+4
| | | | | | | | | | | | | | | | | | | | In case there is both a tag and branch called "foo", the tag is returned if calling getRef with the short name. By using refs/heads/foo, the branch is returned. Bug: 417158 Change-Id: I86b4f83955586bb24774fd621f5012499cf67909 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Merge "Added the git-describe implementation"Matthias Sohn2013-10-023-0/+292
|\ \
| * | Added the git-describe implementationKohsuke Kawaguchi2013-09-273-0/+292
| |/ | | | | | | | | | | | | | | | | | | CQ: 7609 Bug: 339246 Change-Id: I689bc0578ce3a430b9800ad84122e221c69829f4 Signed-off-by: Kohsuke Kawaguchi <kk@kohsuke.org> Also-By: Robin Stocker<robin@nibor.org> Also-By: Matthias Sohn <matthias.sohn@sap.com> Also-By: Christian Halstrick <christian.halstrick@sap.com>
* / Do not close ArchiveOutputStream on errorJonathan Nieder2013-09-231-2/+2
|/ | | | | | | | | | | | | | | | | | | | If we encounter an I/O error while writing an archive (for example due to the reader of an HTTP stream closing the connection), the result is an archive with unclosed entries, causing TarArchiveOutputStream.finish() to throw IOException("This archives contains unclosed entries"), hiding the IOException that caused the early termination. The unclosed entries are fine: the same exception that occured in the first place will probably prevent closing the entries before finishing this partial archive that should be discarded anyway. It would be nicer to call TarArchiveOutputStream.finish and leave the underlying OutputStream unclosed --- all callers close it already --- but that would be a more invasive change so we hold off for now. Change-Id: I328ced19aa8a1888e5353cdbb6106a85fd72d5d7 Signed-off-by: Jonathan Nieder <jrn@google.com>
* Ignore bitmap indexes that do not match the pack checksumColby Ranger2013-09-191-8/+8
| | | | | | | | | | If `git gc` creates a new pack with the same file name, the pack checksum may not match that in the .bitmap. Fix the PackFile implementaion to silently ignore invalid bitmap indexes. Fixes Issue https://code.google.com/p/gerrit/issues/detail?id=2131 Change-Id: I378673c00de32385ba90f4b639cb812f9574a216
* Remove unneeded packs when compacting with no new objectsColby Ranger2013-09-161-1/+7
| | | | | | | Previously, the DfsPackCompactor exited without pruning the existing packs, when no new packs were created. Change-Id: I5e3b6f8c789706c7a982e6ae93cf7c3d4346797c
* ResetCommand: Allow reset on unborn branch when ref not specifiedRobin Stocker2013-09-132-57/+86
| | | | | | | | | | | | | In C Git 1.8.2, "git reset" now also works on an unborn branch (no HEAD yet) if no explicit ref was specified. In that case, it is treated as a reset to an empty tree. This can be useful for callers because "unborn branch" no longer has to be special-cased to "git rm --cached". Bug: 414870 Change-Id: Ied750116f767518ae4d48823cf00752b049a8477 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Don't treat "/" as valid ignore patternRobin Stocker2013-09-091-1/+1
| | | | | | | | This matches the behavior of C Git. Bug: 415767 Change-Id: Ifa6500f3f6a033da40c48287630b77c47b15f4a0 Signed-off-by: Robin Stocker <robin@nibor.org>
* Remove unnecessary inflate stride in DfsBlockShawn Pearce2013-09-042-43/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | OpenJDK 7 does not benefit from using an inflate stride on the input array. The implementation of java.util.zip.Inflater supplies the entire input byte[] to libz, with no regards for the bounds supplied. Slicing at 512 byte increments in DfsBlock no longer has any benefit. In OpenJDK 6 the native portion of Inflater used GetByteArrayRegion to obtain a copy of the input buffer for libz. In this use case supplying a small stride made sense, it avoided allocating space for and copying data past the end of the object's compressed stream. In OpenJDK 7 the native code uses GetPrimitiveArrayCritical, which tries to avoid copying by freezing Java garbage collection and accessing the byte[] contents in place. On OpenJDK 7 derived JVMs it is likely more efficient to supply the entire DfsBlock. Since OpenJDK 5 and 6 are deprecated and replaced by OpenJDK 7 it is reasonable to suggest any consumers running JGit with DFS support use an OpenJDK 7 derived JVM. However, JGit still targets local filesystem support on Java 5, so it is still not reasonble to apply this same simplification to the internal.storage.file package. See: JDK-6751338 (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6751338) Change-Id: Ib248b6d383da5c8aa887d9c355a0df6f3e2247a5
* LogCommand: Remove outdated TODO and improve docsRobin Stocker2013-08-251-3/+17
| | | | | Change-Id: I368be12e7bdc3c711e9f474ead312006513764b7 Signed-off-by: Robin Stocker <robin@nibor.org>
* Enable LsRemoteCommand to work without local repositoryRobin Stocker2013-08-132-1/+18
| | | | | | | | It's supported by C Git and can be useful. Bug: 413388 Change-Id: I12c6c10e791cc09ee271d89eb8b8d32f53e385db Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add missing @since tag for replaceLineBreaksWithSpaceRobin Stocker2013-08-121-0/+1
| | | | | Change-Id: Ibd9d9ba609a2cd7707b985cdb07405dce0422aab Signed-off-by: Robin Stocker <robin@nibor.org>
* Merge "Recognize CRLF when parsing the short message of a commit or tag"Robin Rosenberg2013-08-104-5/+35
|\
| * Recognize CRLF when parsing the short message of a commit or tagRobin Rosenberg2013-06-144-5/+35
| | | | | | | | | | Bug: 400707 Change-Id: I9b09bb88528af465018fc0278f5441f7e6b75986
* | Merge "Added characters to be escaped in file name patterns"Robin Rosenberg2013-08-101-20/+44
|\ \
| * | Added characters to be escaped in file name patternsGustav Karlsson2013-04-061-20/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally, characters could not be escaped in FileNameMatcher patterns. This breaks file name matching when escaped brackets "\[" and "\]" are used in the pattern. A fix has been implemented to allow for any character to be escaped by prepending it with a '\' Bug: 340715 Change-Id: Ie46fd211931fa09ef3a6a712bd1da3d7fb64c5e3 Signed-off-by: Gustav Karlsson <gustav.karlsson@tieto.com>
* | | Add missing @since tagsLars Vogel2013-08-103-0/+8
| | | | | | | | | | | | | | | Change-Id: I9754e2124c0fe6ad2dbde5597c3ed10f1c3efef5 Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>