summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
Commit message (Collapse)AuthorAgeFilesLines
* Merge "ReftableCompactor should accept 0 for minUpdateIndex"Jonathan Nieder2017-11-141-0/+326
|\
| * ReftableCompactor should accept 0 for minUpdateIndexMinh Thai2017-11-141-0/+326
| | | | | | | | | | | | | | | | Do not use 0 as the unset value for minUpdateIndex, as input reftables may have minUpdateIndex starting at 0. Change-Id: Ie040a6b73d4a5eba5521e51d0ee4580713c84a3e Signed-off-by: Minh Thai <mthai@google.com>
* | FileUtils.toPath to convert File to PathMarc Strapetz2017-11-141-1/+2
|/ | | | | | | | | | | When invoking File.toPath(), an (unchecked) InvalidPathException may be thrown which should be converted to a checked IOException. For now, we will replace File.toPath() by FileUtils.toPath() only for code which can already handle IOExceptions. Change-Id: I0f0c5fd2a11739e7a02071adae9a5550985d4df6 Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
* Remove an unused import from PackParserTestMatthias Sohn2017-11-111-1/+0
| | | | Change-Id: I4182a1746b09dedab648e457d1ece6d667a01f12 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge changes I22a8874b,I68ed4abd,I740bc4bf,Icbd17d15Jonathan Nieder2017-11-101-11/+94
|\ | | | | | | | | | | | | | | * changes: BitmapWalker: do not revisit objects in bitmap Use bitmaps for non-commit reachability checks Make PackWriterBitmapWalker public UploadPackTest: construct commits in test method
| * Use bitmaps for non-commit reachability checksJonathan Tan2017-11-101-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, unless RequestPolicy#ANY is used, UploadPack rejects all non-commit "want" lines unless they were advertized. This is fine, except when "uploadpack.allowreachablesha1inwant" is true (corresponding to RequestPolicy#REACHABLE_COMMIT), in which case one would expect that "want"-ing anything reachable would work. (There is no restriction that "want" lines must only contain commits - it is allowed for refs to directly point to trees and blobs, and requesting for them using "want" lines works.) This commit has been written to avoid performance regressions as much as possible. In the usual (and currently working) case where the only unadvertized things requested are commits, we do a standard RevWalk in order to avoid incurring the cost of loading bitmaps. However, if unadvertized non-commits are requested, bitmaps are used instead, and if there are no bitmaps, a WantNotValidException is thrown (as is currently done). Change-Id: I68ed4abd0e477ff415c696c7544ccaa234df7f99 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
| * UploadPackTest: construct commits in test methodJonathan Tan2017-11-011-11/+7
| | | | | | | | | | | | | | | | In a subsequent commit, more tests will be added. This commit allows those tests to reuse fields. Change-Id: Icbd17d158cfe3ba4dacbd8a11a67f9e7607b41b3 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* | Reject pack if delta exceeds array size limitShawn Pearce2017-11-091-1/+1
| | | | | | | | | | | | | | | | | | JGit's delta handling code requires the target to be a single byte array. Any attempt to inflate a delta larger than fits in the 2GiB limit will fail with some form of array index exceptions. Check for this overflow early and abort pack parsing. Change-Id: I5bb3a71f1e4f4e0e89b8a177c7019a74ee6194da
* | Suppress "Unlikely argument type for equals()" warnings in testsDavid Pursehouse2017-11-063-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new warning was introduced in Eclipse 4.7 Oxygen [1]. The only instances of the warning are in test code that is asserting that some class does not compare equal to Strings. As in the Gerrit project [2] these asserts are arguably overkill, but arguably also a reasonable test of an equals implementation. Ignore the warning in these cases. Note that if the project is opened in an earlier version of Eclipse, a warning "Unsupported @SuppressWarnings" will be emitted. [1] https://www.eclipse.org/eclipse/news/4.7/M6/ [2] https://gerrit-review.googlesource.com/#/c/gerrit/+/110339/ Change-Id: I08ea33d71e6009cf0f37e6492a475931f447256b Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Merge branch 'stable-4.9'David Pursehouse2017-11-021-0/+539
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: PackInserter: Implement newReader() Move some strings from DfsText to JGitText FileRepository: Add pack-based inserter implementation ObjectDirectory: Factor a method to close open pack handles ObjectDirectory: Remove last modified check in insertPack Change-Id: Ifc9ed6f5d8336bc978818a64eae122bceb933e5d
| * | PackInserter: Implement newReader()Dave Borowitz2017-11-011-1/+119
| | | | | | | | | | | | Change-Id: Ib9e7f6439332eaed3d936f895a5271a7d514d3e9
| * | FileRepository: Add pack-based inserter implementationDave Borowitz2017-11-011-0/+421
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications that use ObjectInserters to create lots of individual objects may prefer to avoid cluttering up the object directory with loose objects. Add a specialized inserter implementation that produces a single pack file no matter how many objects. This inserter is loosely based on the existing DfsInserter implementation, but is simpler since we don't need to buffer blocks in memory before writing to storage. An alternative for such applications would be to write out the loose objects and then repack just those objects later. This operation is not currently supported with the GC class, which always repacks existing packs when compacting loose objects. This in turn requires more CPU-intensive reachability checks and extra I/O to copy objects from old packs to new packs. So, the choice was between implementing a new variant of repack, or not writing loose objects in the first place. The latter approach is likely less code overall, and avoids unnecessary I/O at runtime. The current implementation does not yet support newReader() for reading back objects. Change-Id: I2074418f4e65853b7113de5eaced3a6b037d1a17
* | | Revert "Throw BinaryBlobException from RawParseUtils#lineMap."Han-Wen NIenhuys2017-10-242-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f2e64cd895a6aa4f18ab3b876f13b7814fb98f04. The newly added throws clause breaks backward compatibility. Change-Id: Ifa76a1b95935e52640b81cd53c171eb17da175c2 Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
* | | Throw BinaryBlobException from RawParseUtils#lineMap.Han-Wen Nienhuys2017-10-242-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | This makes detection of binaries exact for ResolveMerger and DiffFormatter: they will classify files as binary regardless of where the '\0' occurs in the text. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Id4342a199628d9406bfa04af1b023c27a47d4014
* | | Avoid loading and merging binary data in ResolveMergerHan-Wen Nienhuys2017-10-241-0/+142
| | | | | | | | | | | | | | | Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Ide4b68872d426aa262142f224acf636c776b35d3
* | | Introduce RawText#load.Han-Wen Nienhuys2017-10-241-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | This method creates a RawText from a blob, but avoids reading the blob if the start contains null bytes. This should reduce the amount of garbage that Gerrit produces for changes with binaries. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Change-Id: Idd202d20251f2d1653e5f1ca374fe644c2cf205f
* | | Merge branch 'stable-4.9'David Pursehouse2017-10-231-10/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | * stable-4.9: Avoid bad rounding "1 year, 12 months" in date formatter Ensure that ~ in ssh config is replaced before Jsch sees it Change-Id: If6ca55f9447aaea3d7c2d36c03520d5e6dd5193e Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
| * | Avoid bad rounding "1 year, 12 months" in date formatterMichael Keppler2017-10-231-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Round first, then calculate the labels. This avoids "x years, 12 months" and instead produces "x+1 years". One test case has been added for the original example the bug was found with, and one assertion has been moved from an existing test case to the new test case, since it also triggered the bug. Bug: 525907 Change-Id: I3270af3850c4fb7bae9123a0a6582f93055c9780 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | Ensure that ~ in ssh config is replaced before Jsch sees itThomas Wolf2017-10-181-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do tilde replacement for values from the ssh config file that are file names in all cases to make sure that they are already replaced when Jsch tries to get the values. Previously, OpenSshConfig did tilde replacement only for the IdentityFile in the JGit-facing "Host" interface and left the replacement in the Jsch-facing "Config" interface to Jsch. But on Windows the JGit notion of what should be used to replace the tilde differs from Jsch's replacement. Jsch always replaces the tilde by the value of the system property "user.home", whereas JGit also considers some environment variables like %HOME%. This can lead to rather surprising failures as in the case of bug 526175 where %HOME% != user.home. Prior to commit 9d24470 (i.e.,prior to JGit 4.9.0) this problem never occurred because Jsch was completely unaware of the ssh config file and all host and IdentityFile handling happened exclusively in JGit. Bug: 526175 Change-Id: I1511699664ffea07cb58ed751cfdb79b15e3a99e Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
| * | Prepare 4.9.1-SNAPSHOT buildsMatthias Sohn2017-10-082-47/+47
| | | | | | | | | | | | | | | Change-Id: Ic49fd093d3fe4324c4d83aba74033040fcaa37a6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
| * | JGit v4.9.0.201710071750-rv4.9.0.201710071750-rMatthias Sohn2017-10-072-2/+2
| | | | | | | | | | | | | | | Change-Id: I487f6aa3d0c4ef1d57f91cdc36177d994ae24c51 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* | | dfs: Switch InMemoryRepository to DfsReftableDatabaseShawn Pearce2017-10-181-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensure DfsReftableDatabase is tested by the same test suites that use/test InMemoryRepository. It also simplifies the logic of InMemoryRepository and brings its compatibility story closer to any other DFS repository that uses reftables for its reference storage. Change-Id: I881469fd77ed11a9239b477633510b8c482a19ca Signed-off-by: Minh Thai <mthai@google.com> Signed-off-by: Terry Parker <tparker@google.com>
* | | Merge changes from topic 'reftable'Terry Parker2017-10-181-1/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | * changes: dfs: reftable backed DfsRefDatabase Support symbolic references in ReceiveCommand
| * | | Support symbolic references in ReceiveCommandShawn Pearce2017-10-181-1/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow creating symbolic references with link, and deleting them or switching to ObjectId with unlink. How this happens is up to the individual RefDatabase. The default implementation detaches RefUpdate if a symbolic reference is involved, supporting these command instances on RefDirectory. Unfortunately the packed-refs file does not support storing symrefs, so atomic transactions involving more than one symref command are failed early. Updating InMemoryRepository is deferred until reftable lands, as I plan to switch InMemoryRepository to use reftable for its internal storage representation. Change-Id: Ibcae068b17a2fc6d958f767f402a570ad88d9151 Signed-off-by: Minh Thai <mthai@google.com> Signed-off-by: Terry Parker <tparker@google.com>
* / | Avoid bad rounding "1 year, 12 months" in date formatterMichael Keppler2017-10-181-1/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Round first, then calculate the labels. This avoids "x years, 12 months" and instead produces "x+1 years". One test case has been added for the original example the bug was found with, and one assertion has been moved from an existing test case to the new test case, since it also triggered the bug. Bug: 525907 Change-Id: I3270af3850c4fb7bae9123a0a6582f93055c9780 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* / Prepare 4.10.0-SNAPSHOT buildsMatthias Sohn2017-10-082-47/+47
|/ | | | | Change-Id: I5ca462d1db18a2c5c9382cfb9c83972510fa2b88 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use a new RevWalk for validating not advertised wantsZhen Chen2017-10-051-0/+90
| | | | | | | | | | | | | | Shadow commits in the RevWalk in the UploadPack object may cause the UNINTERESTING flag not being carried over to their parents commits since they were marked NO_PARENTS during the assumeShallow or initializeShallowCommits call. A new RevWalk needs to be created for this reason, but instead of creating a new RevWalk from Repository, we can reuse the ObjectReader in the RevWalk of UploadPack to load objects. Change-Id: Ic3fee0512d35b4f555c60e696a880f8b192e4439 Signed-off-by: Zhen Chen <czhen@google.com>
* ReflogWriter: Align auto-creation defaults with C gitDave Borowitz2017-09-301-10/+11
| | | | | | | | | | Per git-config(1), core.logAllRefUpdates auto-creates reflogs for HEAD and for refs under heads, notes, tags, and for HEAD. Add notes and remove stash from ReflogWriter#shouldAutoCreateLog. Explicitly force writing reflogs for refs/stash at call sites, now that this is supported. Change-Id: I3a46d2c2703b7c243e0ee2bbf6948279800c485c
* Support force writing reflog on a per-update basisDave Borowitz2017-09-302-6/+75
| | | | | | | | | | Even if a repository has core.logAllRefUpdates=true, ReflogWriter does not create reflog files unless the refs are under a hard-coded list of prefixes, or unless the forceWrite bit is set. Expose the forceWrite bit on a per-update basis in RefUpdate/BatchRefUpdate/ReceiveCommand, creating RefLogWriters as necessary. Change-Id: Ifc851fba00f76bf56d4134f821d0576b37810f80
* Ensure ReflogWriter only works with a RefDirectoryDave Borowitz2017-09-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The ReflogWriter constructor just took a Repository and called getDirectory() on it to figure out the reflog dirs, but not all Repository instances use this storage format for reflogs, so it's incorrect to attempt to use ReflogWriter when there is not a RefDirectory directly involved. In practice, ReflogWriter was mostly only used by the implementation of RefDirectory, so enforcing this is mostly just shuffling around calls in the same internal package. The one exception is StashDropCommand, which writes to a reflog lock file directly. This was a reasonable implementation decision, because there is no general reflog interface in JGit beyond using (Batch)RefUpdate to write new entries to the reflog. So to implement "git stash drop <N>", which removes an arbitrary element from the reflog, it's fair to fall back to the RefDirectory implementation. Creating and using a more general interface is well beyond the scope of this change. That said, the old behavior of writing out the reflog file even if that's not the reflog format used by the given Repository is clearly wrong. Fail fast in this case instead. Change-Id: I9bd4b047bc3e28a5607fd346ec2400dde9151730
* ChangeIdUtilTest: Remove unused notestCommitDashVDavid Pursehouse2017-09-301-17/+0
| | | | | | | | | | | | | | | | This test was never being run. Since it was introduced it was named "notest.." which meant it didn't run with JUnit3, and since it is not annotated @Test it also doesn't run with JUnit4. When compiling with Bazel 0.6.0, error-prone raises an error that the public method is not annotated with @Ignore or @Test. Given that the test has never been run anyway, we can just remove it. Bug: 525415 Change-Id: Ie9a54f89fe42e0c201f547ff54ff1d419ce37864 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Support http.<url>.* configsThomas Wolf2017-09-102-0/+432
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git has a rather elaborate mechanism to specify HTTP configuration options per URL, based on pattern matching the URL against "http" subsection names.[1] The URLs used for this matching are always the original URLs; redirected URLs do not participate. * Scheme and host must match exactly case-insensitively. * An optional user name must match exactly. * Ports must match exactly after default ports have been filled in. * The path of a subsection, if any, must match a segment prefix of the path of the URL. * Matches with user name take precedence over equal-length path matches without, but longer path matches are preferred over shorter matches with user name. Implement this for JGit. Factor out the HttpConfig from TransportHttp and implement the matching and override mechanism. The set of supported settings is still the same; JGit currently supports only followRedirects, postBuffer, and sslVerify, plus the JGit-specific maxRedirects key. Add tests for path normalization and prefix matching only on segment separators, and use the new mechanism in SmartClientSmartServerSslTest to disable sslVerify selectively for only the test server URLs. Compare also bug 374703 and bug 465492. With this commit it would be possible to set sslVerify to false for only the git server using a self-signed certificate instead of having to switch it off globally via http.sslVerify. [1] https://git-scm.com/docs/git-config Change-Id: I42a3c2399cb937cd7884116a2a32fcaa7a418fcb Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Add PushConfig class with PushRecurseSubmodulesModeDavid Pursehouse2017-09-091-0/+88
| | | | | | | | This will be used later when adding for support for recursing submodules on push. Change-Id: Ie2a183e5404a32046de9f6524e6ceeec37919671 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Fix missing RefsChangedEvent when packed refs are usedThomas Wolf2017-09-071-0/+70
| | | | | | | | | | | | | | | With atomic ref updates using packed refs, JGit did not fire a RefsChangedEvent. This resulted in a user-visible regression in EGit: the UI would not update after a "Fetch from upstream...". Presumably it would also make Gerrit miss out on ref changes? Strengthen the BatchRefUpdateTest by also asserting the expected number of RefsChangedEvents, and ensure modCnt is incremented in RefDirectory.commitPackedRefs() when refs really changed (as opposed to some internal housekeeping operation, such as packing loose refs). Bug: 521296 Change-Id: Ia985bda1d99f45a5f89c8020ca4845e7a66e743e Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Add FetchCommand#setRefSpecs(String...) variantDave Borowitz2017-09-072-16/+12
| | | | | | | | Much of the time the caller can specify a RefSpec succinctly using a string, and doesn't care about calling setters. Add a convenience method for this case, and use it where applicable in JGit core. Change-Id: Ic3fac7fc568eee4759236a5264d2e7e5f9b9716d
* ReceivePack: clear advertised .haves if application changes refsShawn Pearce2017-09-071-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | An application can choose to invoke setAdvertisedRefs multiple times, for example several AdvertiseRefsHook installed in a chain. Each of these invocations populates the advertisedHaves collection with the unique set of ObjectIds. This can lead to a server over-advertising with ".have" lines if the first hook pushes in a lot of references, and the second hook filters this to a subset. ReceivePack will advertise the unique objects from the first hook using ".have" lines, which may lead to a huge advertisement sent to the client. This can also contribute to a very slow connectivity check after the pack is parsed as ReceivePack calls markUninteresting on every commit in advertisedHaves. This may require expanding a lot of subtrees to mark all trees as uninteresting as well. On a very big repository this can lead to a many-second stall. Clear the advertisedHaves collection any time the refs are updated. Add a test to verify the correct set of objects was sent. Change-Id: I97f6998d0597251444a2e846a3ea1f461bae96f9
* ObjectCheckerTest: Factor duplicate instances out to constantsDavid Pursehouse2017-09-061-72/+42
| | | | | | | | | | | | | | | | | | | | | | | | | The tests: - testCheckBlobNotCorrupt - testCheckBlobCorrupt create instances of ObjectChecker that are the same. The tests: - testCheckBlobWithBlobObjectCheckerNotCorrupt - testCheckBlobWithBlobObjectCheckerCorrupt also create instances of ObjectChecker that are the same. Factor these instances out to constants instead of creating them in the tests. The `checker` member is still created anew in each test, since some of the tests change its state. Change-Id: I2d90263829d01d208632185b1ec2f678ae1a3f4c Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* SubmoduleConfigTest: Add additional tests in fetchRecurseToConfigValueDavid Pursehouse2017-09-051-0/+2
| | | | | | | Add tests for "true" and "false" matching to "YES" and "NO". Change-Id: I58223855022871ac4b21bd34ff6a9cd00fce30a1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Merge changes from topic 'dfs-reftable'Shawn Pearce2017-09-051-0/+190
|\ | | | | | | | | | | * changes: dfs: write reftable from DfsGarbageCollector dfs: compact reftables during DfsPackCompactor
| * dfs: write reftable from DfsGarbageCollectorShawn Pearce2017-09-051-0/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a ReftableConfig has been supplied by the caller, write out a reftable as a sibling of the the GC pack, alongside the heads. To bootstrap from a non-reftable system, the refs are read from the DfsRefDatabase if no GC reftables are present. Its assumed the references are fully current, and do not need to be merged with any other reftables. Any non-GC reftables will be pruned at the end of the GC cycle, just like any packs that were replaced. If a GC reftable is present, all existing reftables are compacted, and references from DfsRefDatabase are only used to seed the packer. Its assumed these are consistent with each other. Change-Id: Ie397eb58aaaefb6865c816d9b39de3ac12998019
* | Fix Daemon.stop() to actually stop the listener threadThomas Wolf2017-09-041-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ServerSocket.accept() is not interruptible: a thread busy in accept() may not react to Thread.interrupt() and may not return from accept() via an InterruptedException. Close the socket instead to make the daemon's listener thread terminate. * Close the listening socket to get the listening thread to exit instead of interrupting it. * Add a stopAndWait() method that stops the listening thread and then waits until it has indeed finished. * Set SO_REUSE_ADDRESS on the listening socket. Bug: 376369 Change-Id: I9d6014103e6dcb0173daea134feb44dc52c5c69a Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | Don't assume name = path in .gitmodulesThomas Wolf2017-09-041-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While parsing .gitmodules, the name of the submodule subsection is purely arbitrary: it frequently is the path of the submodule, but there's no requirement for it to be. By building a map of paths to the section name in .gitmodules, we can more accurately return the submodule URL. Bug: 508801 Change-Id: I8399ccada1834d4cc5d023344b97dcf8d5869b16 Also-by: Doug Kelly <dougk.ff7@gmail.com> Signed-off-by: Doug Kelly <dougk.ff7@gmail.com> Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* | Fix some tests for running in bazelThomas Wolf2017-08-313-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests call out to external cgit. Those tests all failed for me locally on Mac. Turned out that the reason was that the system git config used by the git in the bazel run contained paths with ~/ but somehow $HOME was not set. As a result the external git returned with exit code 128. Fix this by passing along $HOME explicitly. Also improve assertions to make sure we do get the stderr of the external command in the test log. I hadn't noticed that until now because apparently the maven build does pass along $HOME. Change-Id: I7069676d5cc7b23a71e79a4866fe8acab5a405f4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* | Add dependency to jsch for OpenSshConfigTest to bazel buildThomas Wolf2017-08-311-0/+4
|/ | | | | | Make jsch visible to the test bundle and add the dependency. Change-Id: I0c49ee9b8f64fe8a8c74d2f08865917eb33069b4 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
* Cleanup: Organize importsMatthias Sohn2017-08-303-9/+10
| | | | Change-Id: I6065e59519bc42bd18f5cc5ee3ec5210764ab03c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Partially revert c0ad77d8 "Enhance Eclipse save actions"Matthias Sohn2017-08-301-1/+1
| | | | | | | | Do not automatically organize imports using a save action since this seems to be buggy and removed some annotations org.eclipse.jgit.pgm needs to use args4j. Change-Id: I5a91292c3b9241ce2dde3e4ecce14ad460097129 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Partially revert c0ad77d8 "Enhance Eclipse save actions"Matthias Sohn2017-08-301-2/+2
| | | | | | | | | | | | | | | | | | | | Revert the following save actions which were introduced in c0ad77d8: - always use braces around blocks - remove unused imports Other than I expected save actions are run globally on edited files - and not only on edited code lines only. Hence revert the save action "Convert control statement bodies to blocks" which would affect a large number of code lines not affected by the change editing some small part of a class. This would generate a large number of changes which may lead to many unnecessary conflicts. Total number of affected lines across jgit would be around 10k lines. Also revert "Remove unused imports" since it erroneously removes imports of some annotations needed by pgm classes using args4j. Change-Id: I879a47f68e664129e6124cf25c1ae1f6a2d7a5aa Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Merge "reftable: explicitly store update_index per ref"Shawn Pearce2017-08-282-13/+55
|\
| * reftable: explicitly store update_index per refShawn Pearce2017-08-212-13/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an update_index to every reference in a reftable, storing the exact transaction that last modified the reference. This is necessary to fix some merge race conditions. Consider updates at T1, T3 are present in two reftables. Compacting these will create a table with range [T1,T3]. If T2 arrives during or after the compaction its impossible for readers to know how to merge the [T1,T3] table with the T2 table. With an explicit update_index per reference, MergedReftable is able to individually sort each reference, merging individual entries at T3 from [T1,T3] ahead of identically named entries appearing in T2. Change-Id: Ie4065d4176a5a0207dcab9696ae05d086e042140
* | Merge "Enhance Eclipse save actions"David Pursehouse2017-08-281-7/+12
|\ \