aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Handle content length in WorkingTreeIteratorRobin Rosenberg2012-03-276-79/+111
| | | | | | | | | | 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
* Properly parse first line in ReceivePack with no '\0'Dave Borowitz2012-03-231-2/+3
| | | | Change-Id: Ic98e17aff4e4b3c3fa0359082bab689e4522e3d7
* Revert "Allow to write tests with CLI syntax"Matthias Sohn2012-03-2325-1304/+1
| | | | | | | | | 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-2225-1/+1304
|\
| * Allow to write tests with CLI syntaxTomasz Zarna2012-03-2225-1/+1304
| | | | | | | | | | Bug: 365444 Change-Id: I86f382913bc47665c5b9a2827b878e7dbedce7b1 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | Add command support for dropping a stashed commitKevin Sawicki2012-03-218-115/+849
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-214-2/+130
| | | | | | | | | | | | | | | | | | | | 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-213-8/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-212-31/+209
|/ | | | | | | | | | 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>
* Clarify the purpose of ObjectInserter.buffer()Shawn O. Pearce2012-03-181-4/+28
| | | | | | | | | | | | | | | | | Recently Robin tried to increase the size of the buffer used by ObjectInserter to fix a bug in the InputStream that handles AutoCRLF. The purpose of this buffer is NOT to make a random InputStream work correctly by passing it a larger buffer during read(byte[],int,int). Clarify the Javadoc on the buffer() method to reduce the risk someone tries to abuse it again. While we are here, modify the method to load the field into a local variable before returning. This should cut down 1 field load during the common case of the buffer being already allocated. Change-Id: Ic6898530d10fcd7e59f90397117a4a0d97e1f031 Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* LogCommand#setMaxCount affects all commitsTomasz Zarna2012-03-182-5/+33
| | | | | | | Bug: 370132 Change-Id: I9f5ff3640a4f69c0b48c97609728d7672e63e6ab Signed-off-by: Matthias Sohn <matthias.sohn@sap.com> Signed-off-by: Chris Aniszczyk <zx@twitter.com>
* Pass a DfsRepositoryDescription to InMemoryRepositoryDave Borowitz2012-03-151-2/+2
| | | | | | | This was likely intended originally, but this class had never been used, so the mistake went unnoticed. Change-Id: I5e0e9f22ebf707c11d0581511c7a56b182188f77
* Revert "Quickfix for AutoCRLF handling"Shawn O. Pearce2012-03-154-57/+5
| | | | | | | | | | | 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-132-49/+342
| | | | | | | | | | | | | | | | | | | 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>
* Merge "Enable smart HTTP transport to place EOF at end of pack"Shawn O. Pearce2012-03-132-7/+35
|\
| * Enable smart HTTP transport to place EOF at end of packShawn O. Pearce2012-03-132-7/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When fetching over smart HTTP the InputStream that gets fed into a PackParser doesn't really support EOF at the end of the pack. It instead tries to make a new HTTP request, which fails because there is no request body currently buffered by the client. Make EOF work correctly on the end of an HTTP derived InputStream for the pack by denoting no more requests are expected as the higher level code is now consuming the pack (or side-band embedded pack). Smart HTTP support doesn't automatically enqueue execute support onto the end of the UnionInputStream, which allows the UnionInputStream to correctly reflect EOF when the HTTP response is consumed. Change-Id: I975f1ab1c81ab1c1af925716970088bc7b8d6b1a
* | Do not import/export empty org.eclipse.jgit packageTomasz Zarna2012-03-133-5/+2
|/ | | | | | The package was removed in I763590a45d75f00a09097ab6f89581a3bbd3c797 Change-Id: Ifa9e75714f85d17609f9bf61581aaed0631a6fa7 Signed-off-by: Kevin Sawicki <kevin@github.com>
* Move JGitText to an internal packageRobin Rosenberg2012-03-12206-202/+205
| | | | Change-Id: I763590a45d75f00a09097ab6f89581a3bbd3c797
* Merge changes Ic0ee9c08,Ia3e82682,I8d8ab547,I8f2cd0a0,I45823b0c,Ie22ac47eShawn Pearce2012-03-1210-30/+24
|\ | | | | | | | | | | | | | | | | | | * 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: Silence an unused-parameter warningRobin Rosenberg2012-03-091-0/+1
| | | | | | | | Change-Id: Ic0ee9c08642d4efc6ef1f2333ebe6614e9c2df87
| * cleanup: Get rid of some unused-warningsRobin Rosenberg2012-03-092-3/+3
| | | | | | | | Change-Id: Ia3e82682781c6b5bc3141b3e27db67b93c3162cd
| * cleanup: Remove unused parameter in ConsoleCredentialsProviderRobin Rosenberg2012-03-091-8/+8
| | | | | | | | Change-Id: I8d8ab54736c6d57e6211928def8632acb1f5b621
| * cleanup: Drop unused parameter on DhtPackParserRobin Rosenberg2012-03-091-4/+4
| | | | | | | | Change-Id: I8f2cd0a04cc95a02c49c16dade1b3509cba02e2d
| * cleanup: Remove unneeded parameter to private method in RefUpdateTestRobin Rosenberg2012-03-091-10/+8
| | | | | | | | Change-Id: I45823b0c1ad5d249d539d7c8e1180ad7432abb3e
| * cleanup: Remove unnecessary @SuppressWarningsRobin Rosenberg2012-03-094-5/+0
| | | | | | | | | | Change-Id: Ie22ac47e315bff76f224214bc042fc483eb01550 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
* | Merge "Use object id provided by working tree iterator for submodules"Shawn Pearce2012-03-121-16/+4
|\ \
| * | Use object id provided by working tree iterator for submodulesKevin Sawicki2012-03-101-16/+4
| | | | | | | | | | | | | | | | | | | | | | | | The working tree iterator now supports providing an object id for submodule entries and this value should be used instead of recomputing it again in AddCommand. Change-Id: I30082514c23fc65968bb78add5ad69a1ca95cf3a
* | | Fix compilation error due to missing javadoc.Markus Duft2012-03-121-1/+3
|/ / | | | | | | | | | | | | | | Another change introduced this problem. With default JGit project settings there is a compilation problem as javadoc problems are set to Error in the project preferences. Change-Id: I81e3ceeb02f7a2119b2a6cfefb7fbd9e83771fc9
* | Keep submodules in index that are missing in working directoryKevin Sawicki2012-03-102-2/+40
| | | | | | | | | | | | | | | | | | | | | | 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 "Export all packages from org.eclipse.jgit.pgm"Matthias Sohn2012-03-091-1/+4
|\ \
| * | Export all packages from org.eclipse.jgit.pgmTomasz Zarna2012-03-071-1/+4
| | | | | | | | | | | | Change-Id: I90565c8626aa5ab58ed3ff1dafa8bd21c9a79c62
* | | Merge "EolCanonicalizingInputStream: binary detection should be optional"Robin Rosenberg2012-03-093-17/+30
|\ \ \
| * | | EolCanonicalizingInputStream: binary detection should be optionalMarc Strapetz2012-02-213-17/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Fix rebase > continue when nothing left to commit."Stefan Lay2012-03-093-3/+82
|\ \ \ \
| * | | | Fix rebase > continue when nothing left to commit.Markus Duft2012-03-093-3/+82
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Revert non-sense logic in IO.readFully"Robin Rosenberg2012-03-091-7/+1
|\ \ \ \ | |/ / / |/| | |
| * | | Revert non-sense logic in IO.readFullyRobin Rosenberg2012-02-121-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This was introduced in alleged support for autocrlf, but the logic makes no sense here. Change-Id: If37f3b90f21f875cee7165e17a17adfda446384d
* | | | Use readString() to trim trailing LF from first lineShawn O. Pearce2012-03-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fetch-pack/upload-pack stream usually has an LF at the end of the first "want" line. Trim this when checking to see if side-band or side-band-64k was used. Perform the same trim for send-pack/receive-pack, as it is harmless in this context to ignore an LF just before doing an error report. Change-Id: I6ef946bb6124fa72c52bd5320187eaac3ed906e7
* | | | Merge changes I8277fd45,I7ac4e0ae,Ib475dfc0,Ib26adf95Shawn Pearce2012-03-077-51/+341
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | * changes: Try to send HTTP error messages over sideband Extract the capability parsing logic in {Upload,Receive}Pack Make capability strings in BasePack{Fetch,Push}Connection public Fix a typo in "capabilities" in ReceivePack
| * | | Try to send HTTP error messages over sidebandDave Borowitz2012-03-075-19/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a client POSTs to /git-{upload,receive}-pack, the first line includes their client capabilities. As soon as the C git client sends side-band(-64k), it goes into a state where it chokes on data not sent in a valid sideband channel. GitSmartHttpTools.sendError() is called early in the request, likely before a {Upload,Receive}Pack handler is assigned or, even so, before it has read the request. In some cases we must read the first line manually within sendError() to tell whether sideband is needed. Change-Id: I8277fd45a4ec3b71fa8f87404b4f5d1a09e0f384
| * | | Extract the capability parsing logic in {Upload,Receive}PackDave Borowitz2012-03-072-14/+78
| | | | | | | | | | | | | | | | Change-Id: I7ac4e0ae98872a74b01162b5ca936fb15e2f8cff
| * | | Make capability strings in BasePack{Fetch,Push}Connection publicDave Borowitz2012-03-072-14/+28
| | | | | | | | | | | | | | | | Change-Id: Ib475dfc087705ea40e1db37ec9ef28a67fde6d72
| * | | Fix a typo in "capabilities" in ReceivePackDave Borowitz2012-03-071-6/+6
| | | | | | | | | | | | | | | | Change-Id: Ib26adf954dcb90403be9d6ed3b7a425a724c67d0
* | | | Remove ambiguous CheckoutConflictExceptionTomasz Zarna2012-03-065-8/+15
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge "Check connection's error stream before reading from it"Christian Halstrick2012-03-061-1/+5
|\ \ \
| * | | Check connection's error stream before reading from itKevin Sawicki2012-03-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HttpURLConnection.getErrorStream can return null which is currently not guarded against and will throw an NPE preventing the actual error response code from bubbling up. Change-Id: I04fb8dbda16b7df3b82fc579088a303b2fd21e87
* | | | Ignore /targetShawn O. Pearce2012-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Maven seems to be creating target/antrun/build-main.xml. This isn't a tracked file. Elsewhere we blanket ignore /target inside of each plugin/component directory so do the same at the top level. Change-Id: Id799ac6da65e6789e48e28efbdb455153b34ff2e Signed-off-by: Chris Aniszczyk <zx@twitter.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-052-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Return command from StashCreateCommand settersKevin Sawicki2012-03-051-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously were void which made them inconsistent with the fluid setter pattern used in other commands. Change-Id: Idb81dfc7bb097306f0c5d6e34f91a2bbab501668 Signed-off-by: Chris Aniszczyk <zx@twitter.com>