]> source.dussan.org Git - jgit.git/log
jgit.git
5 years agoTrack object inflation time in DfsReaderIoStats 06/138206/2
Terry Parker [Wed, 6 Mar 2019 18:01:16 +0000 (10:01 -0800)]
Track object inflation time in DfsReaderIoStats

This can help track down poor long tail performance that isn't accounted
for in the readIdxMicros or readBlockMicros metrics.

Change-Id: I701b9cfcc124f4ddb860d1766a11ea3557e604ce
Signed-off-by: Terry Parker <tparker@google.com>
5 years agoUpdate Orbit to R20190226160451 16/138116/1
Matthias Sohn [Tue, 5 Mar 2019 23:41:47 +0000 (00:41 +0100)]
Update Orbit to R20190226160451

Change-Id: I43bfd56b029b4bf16aaf001915a9dabeb189a9e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge "Upgrade maven-javadoc-plugin to 3.1.0"
Matthias Sohn [Tue, 5 Mar 2019 19:19:39 +0000 (14:19 -0500)]
Merge "Upgrade maven-javadoc-plugin to 3.1.0"

5 years agoMerge "Merge branch 'stable-5.2'"
Matthias Sohn [Tue, 5 Mar 2019 19:19:28 +0000 (14:19 -0500)]
Merge "Merge branch 'stable-5.2'"

5 years agoMerge "diff: add option metaVar for --src-prefix and --dst-prefix"
Christian Halstrick [Tue, 5 Mar 2019 13:50:42 +0000 (08:50 -0500)]
Merge "diff: add option metaVar for --src-prefix and --dst-prefix"

5 years agoUpgrade maven-javadoc-plugin to 3.1.0 62/138062/1
David Pursehouse [Tue, 5 Mar 2019 10:54:31 +0000 (19:54 +0900)]
Upgrade maven-javadoc-plugin to 3.1.0

Change-Id: I4fc59b02e92db55797b9773648fd1dea88682ade
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.2' 55/137955/2
David Pursehouse [Tue, 5 Mar 2019 01:24:34 +0000 (10:24 +0900)]
Merge branch 'stable-5.2'

* stable-5.2:
  Fix error log message in ObjectDirectory.handlePackError()
  Properly format pack checksums in PackFile.idx()
  Cancel gc if thread was interrupted
  PackFile: report correct message for checksum mismatch
  ObjectDirectory: Clean up logging
  Bazel: Stop using native.git_repository

Change-Id: Ib972641105cef8089791fc65389c4f43e218620a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 54/137954/2
David Pursehouse [Tue, 5 Mar 2019 01:23:38 +0000 (10:23 +0900)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Fix error log message in ObjectDirectory.handlePackError()
  Properly format pack checksums in PackFile.idx()
  Cancel gc if thread was interrupted
  PackFile: report correct message for checksum mismatch
  ObjectDirectory: Clean up logging
  Bazel: Stop using native.git_repository

Change-Id: I42b72a3bba3b4c9389d91a1a35a8004836567e7c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agodiff: add option metaVar for --src-prefix and --dst-prefix 82/137482/3
Andre Bossert [Sat, 23 Feb 2019 15:03:58 +0000 (16:03 +0100)]
diff: add option metaVar for --src-prefix and --dst-prefix

Fixes exception if using "jgit diff --help".

Bug: 544735
Change-Id: I694ff3103da4bc199dd03c40962c5be191eddcd1
Signed-off-by: Andre Bossert <andre.bossert@siemens.com>
5 years agoFix error log message in ObjectDirectory.handlePackError() 90/137990/1
Matthias Sohn [Mon, 4 Mar 2019 12:44:24 +0000 (13:44 +0100)]
Fix error log message in ObjectDirectory.handlePackError()

Change-Id: I154f392ad025c4b642eb1123d375a0afaa853885
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoProperly format pack checksums in PackFile.idx() 89/137989/1
Matthias Sohn [Mon, 4 Mar 2019 12:28:25 +0000 (13:28 +0100)]
Properly format pack checksums in PackFile.idx()

Change-Id: Id805850dbe9a3d633168f3056e06ddeafd86f961
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoCancel gc if thread was interrupted 45/137945/1
Matthias Sohn [Thu, 6 Jul 2017 22:58:28 +0000 (00:58 +0200)]
Cancel gc if thread was interrupted

see
https://groups.google.com/d/msg/repo-discuss/oDB2rl3doDc/tFEh5Xt0CAAJ

Change-Id: Ia6d4631c64e065d8b9b09e0b45e7a9ea8ac3f41d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPackFile: report correct message for checksum mismatch 83/137483/3
Luca Milanesio [Sat, 23 Feb 2019 21:57:09 +0000 (21:57 +0000)]
PackFile: report correct message for checksum mismatch

When the packfile checksum does not match the expected one
report the correct checksum error instead of reporting that
the number of objects is incorrect.

Change-Id: I040f36dacc4152ae05453e7acbf8dfccceb46e0d
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoObjectDirectory: Clean up logging 99/137499/3
David Pursehouse [Sun, 24 Feb 2019 23:35:12 +0000 (08:35 +0900)]
ObjectDirectory: Clean up logging

Externalize the message and log the pack file with absolute path.

Change-Id: I019052dfae8fd96ab67da08b3287d699287004cb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Stop using native.git_repository 32/137932/1
David Pursehouse [Sun, 3 Mar 2019 04:14:46 +0000 (13:14 +0900)]
Bazel: Stop using native.git_repository

The native.git_repository method doesn't work in the latest version
of bazel, and causes the build to fail with:

  type 'struct' has no method git_repository()

Change-Id: Id6a57369b681c0afe811e9e3740b141fb7fb4653
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoResolveMerger: Destroy TemporaryBuffer on unchecked exceptions 02/137902/1
Dave Borowitz [Fri, 1 Mar 2019 20:35:38 +0000 (12:35 -0800)]
ResolveMerger: Destroy TemporaryBuffer on unchecked exceptions

Previously, we called destroy() to delete the temp file on failure only
when catching an IOException, not a RuntimeException. Use a slightly
different construction with a finally block to ensure it's always
deleted on error (assuming the JVM is still healthy enough).

Change-Id: Ie201f3cfc81099ee1cafed066632da76223cef1f

5 years agoExpose the filter blob limit in UploadPack 35/137835/1
Terry Parker [Fri, 1 Mar 2019 00:00:24 +0000 (16:00 -0800)]
Expose the filter blob limit in UploadPack

Similar to UploadPack.getDepth() to know the shallow clone depth, expose
the user-specified filter blob limit for partial clones.

Change-Id: I04bde06862a1cf8a9862d950c15023c49d16a2a6
Signed-off-by: Terry Parker <tparker@google.com>
5 years agoUpgrade error_prone_core to 2.3.3 17/137517/2
David Pursehouse [Mon, 25 Feb 2019 10:13:01 +0000 (19:13 +0900)]
Upgrade error_prone_core to 2.3.3

Change-Id: I31232d09b6dc1e5bb3d3398d34b3dd814165d2dc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge changes from topic 'rebase_compatibility'
Thomas Wolf [Tue, 26 Feb 2019 21:22:21 +0000 (16:22 -0500)]
Merge changes from topic 'rebase_compatibility'

* changes:
  RebaseCommand: tighten check for --preserve-merges on --continue
  RebaseCommand: use orig-head to abort
  RebaseCommand: use orig-head in addition to head

5 years agoMerge "Strongly reference indices in DfsPackFile"
Jonathan Nieder [Tue, 26 Feb 2019 20:08:39 +0000 (15:08 -0500)]
Merge "Strongly reference indices in DfsPackFile"

5 years agoMerge "On Windows use %APPDATA%\gnupg as GPG directory if it exists"
Gunnar Wagenknecht [Tue, 26 Feb 2019 19:46:51 +0000 (14:46 -0500)]
Merge "On Windows use %APPDATA%\gnupg as GPG directory if it exists"

5 years agoMerge "Remove duplicate externalized message"
Christian Halstrick [Tue, 26 Feb 2019 12:35:52 +0000 (07:35 -0500)]
Merge "Remove duplicate externalized message"

5 years agoOn Windows use %APPDATA%\gnupg as GPG directory if it exists 14/137614/1
Thomas Wolf [Tue, 26 Feb 2019 11:49:59 +0000 (12:49 +0100)]
On Windows use %APPDATA%\gnupg as GPG directory if it exists

Hard-coding ~/.gnupg for the GPG directory doesn't work on Windows,
where GnuPG uses %APPDATA%\gnupg by default. Make the determination
of the directory platform-dependent.

Bug: 544797
Change-Id: Id4bfd39a981ef7c5b39fbde46fce9a7524418709
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoRemove duplicate externalized message 07/137607/1
Thomas Wolf [Tue, 26 Feb 2019 10:53:49 +0000 (11:53 +0100)]
Remove duplicate externalized message

Instead of a new "unexpectedNlinkValue" message use the already
existing "failedAtomicFileCreation". Remove a stray double quote
from the latter.

Change-Id: I1ba5e9ea48d3f7615354b2ace2575883070b3206
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoRebaseCommand: tighten check for --preserve-merges on --continue 41/137341/3
Thomas Wolf [Wed, 19 Dec 2018 10:34:35 +0000 (11:34 +0100)]
RebaseCommand: tighten check for --preserve-merges on --continue

With native git, .git/rebase-merge/rewritten exists actually in two
different cases:

* as a file in git rebase --merge recording OIDs for copying notes
* as a directory in git rebase --preserve-merges

Add a comment, and check for isDirectory() instead of exists().

Bug: 511487
Change-Id: I6a3317b4234d4f41c41b3004cdc7ea0abf2c6223
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoRebaseCommand: fix ONTO_NAME, and --preserve-merges is interactive 38/137338/3
Thomas Wolf [Wed, 19 Dec 2018 10:03:29 +0000 (11:03 +0100)]
RebaseCommand: fix ONTO_NAME, and --preserve-merges is interactive

ONTO_NAME must be "onto_name", not "onto-name".

For native git, --preserve-merges is an interactive mode. Create the
INTERACTIVE marker file, otherwise a native git rebase --continue
will fall back into rebase --merge mode before git 2.19.0 since it
started looking for the REWRITTEN directory to make the distinction
only then.[1]

This allows a JGit interactive rebase to be continued via native git
rebase --continue.

[1] https://github.com/git/git/commit/6d98d0c0

Bug: 511487
Change-Id: I13850e0fd96ac77d03fbb581c8790d76648dbbc6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoRebaseCommand: use orig-head to abort 40/137340/3
Thomas Wolf [Wed, 19 Dec 2018 10:26:21 +0000 (11:26 +0100)]
RebaseCommand: use orig-head to abort

Aborting a rebase used ORIG_HEAD to reset. Strictly speaking this is
not correct, since other commands run during the rebase (for instance,
when the rebase stopped on a conflict) might have changed ORIG_HEAD.

Prefer the OID recorded in the orig-head file, falling back to the
older "head" file if "orig-head" doesn't exist, and use ORIG_HEAD only
if neither exists.

Bug: 511487
Change-Id: Ifa99221bb33e4e4754377f9b8f46e76c8936e072
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoFix core.autocrlf for non-normalized index 24/127324/11
Thomas Wolf [Sun, 12 Aug 2018 17:30:36 +0000 (19:30 +0200)]
Fix core.autocrlf for non-normalized index

With text=auto or core.autocrlf=true, git does not normalize upon
check-in if the file in the index contains already CR/LFs. The
documentation says: "When text is set to "auto", the path is
marked for automatic end-of-line conversion. If Git decides that
the content is text, its line endings are converted to LF on
checkin. When the file has been committed with CRLF, no conversion
is done."[1]

Implement the last bit as in canonical git: check the blob in the
index for CR/LFs. For very large files, we check only the first 8000
bytes, like RawText.isBinary() and AutoLFInputStream do.

In Auto(CR)LFInputStream, ensure that the buffer is filled as much as
possible for the isBinary() check.

Regarding these content checks, there are a number of inconsistencies:

* Canonical git considers files containing lone CRs as binary.
* RawText checks the first 8000 bytes.
* Auto(CR)LFInputStream checks the first 8096 (not 8192!) bytes.

None of these are changed with this commit. It appears that canonical
git will check the whole blob, not just the first 8k bytes. Also
note: the check for CR/LF text won't work with LFS (neither in JGit
nor in git) since the blob data is not run through the smudge filter.
C.f. [2].

Two tests in AddCommandTest actually tested that normalization was
done even if the file was already committed with CR/LF.These tests
had to be adapted. I find the git documentation unclear about the
case where core.autocrlf=input, but from [3] it looks as if this
non-normalization also applies in this case.

Add new tests in CommitCommandTest testing this for the case where
the index entry is for a merge conflict. In this case, canonical git
uses the "ours" version.[4] Do the same.

[1] https://git-scm.com/docs/gitattributes
[2] https://github.com/git/git/blob/3434569fc/convert.c#L225
[3] https://github.com/git/git/blob/3434569fc/convert.c#L529
[4] https://github.com/git/git/blob/f2b6aa98b/read-cache.c#L3281

Bug: 470643
Change-Id: Ie7310539fbe6c737d78b1dcc29e34735d4616b88
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoRebaseCommand: use orig-head in addition to head 39/137339/3
Thomas Wolf [Wed, 19 Dec 2018 10:07:43 +0000 (11:07 +0100)]
RebaseCommand: use orig-head in addition to head

Since 2011-02-10 (i.e., git 1.7.6)[1] native git uses "orig-head" for
REBASE_HEAD. JGit was still using "head". Currently native git has a
legacy fall-back for reading this, but for how long? Let's write to
both. Note that JGit never reads this file.

[1] https://github.com/git/git/commit/84df4560

Bug: 511487
Change-Id: Id3742bf9bbc0001d850e801b26cc8880e646abfc
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoSHA1: Use externalized message in log 01/137501/2
David Pursehouse [Sun, 24 Feb 2019 23:50:03 +0000 (08:50 +0900)]
SHA1: Use externalized message in log

The non-externalized warning message says there is a "possible SHA-1
collision" but then the Sha1CollisionException is always thrown.

Replace the message with the existing externalised string that does
not say "possible".

Change-Id: I9773ec76b416c356e234a658fb119f98d33eac83
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoJGitText: Remove unnecessary suffix from externalized message identifier 00/137500/2
David Pursehouse [Sun, 24 Feb 2019 23:43:25 +0000 (08:43 +0900)]
JGitText: Remove unnecessary suffix from externalized message identifier

Change-Id: I7a3ade56c219826b81d33d1d52566a86ad2e853a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoFS_POSIX: Externalize log message 98/137498/2
David Pursehouse [Sun, 24 Feb 2019 23:24:19 +0000 (08:24 +0900)]
FS_POSIX: Externalize log message

Change-Id: Ida538e05c4595fdce99f1fa87469a3be60160adb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoStrongly reference indices in DfsPackFile 15/137415/2
Minh Thai [Fri, 22 Feb 2019 00:36:59 +0000 (16:36 -0800)]
Strongly reference indices in DfsPackFile

DfsBlockCache.Ref might get cleared out if the JVM is running out of
memory. As a result, the index is not persisted for the request and
will be reloaded unnecessarily.

Change-Id: I3b57ad5e6673f77f2dc66177a649ac412a97fe20
Signed-off-by: Minh Thai <mthai@google.com>
5 years agoUpdate Orbit to S20190219190953 39/137239/2
Matthias Sohn [Tue, 19 Feb 2019 22:19:55 +0000 (23:19 +0100)]
Update Orbit to S20190219190953

- Orbit milestone for 2019-03 M3
- fixes Apache httpclient 4.5.6

Bug: 544139
Change-Id: Ib225d90dd26f6f3665d4feacecfbba4a28251a0b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpdate README 67/137167/1
David Pursehouse [Mon, 18 Feb 2019 23:33:11 +0000 (08:33 +0900)]
Update README

- Consistently refer to the project as "JGit", rather than "jgit".

- Convert the contribution guide link to markdown syntax.

Change-Id: I896b8112f3f1a77255883e0deb153e8937999a84
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoUpdate README 95/137095/4
Matthias Sohn [Mon, 18 Feb 2019 00:11:57 +0000 (01:11 +0100)]
Update README

Change-Id: Ibf77553f89871e34d7617d2a648fb0dc7904325d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.3' 99/137099/1
David Pursehouse [Mon, 18 Feb 2019 02:22:31 +0000 (11:22 +0900)]
Merge branch 'stable-5.3'

* stable-5.3:
  ObjectDirectory: extra logging on packfile exceptions
  Prepare 5.3.0-SNAPSHOT builds
  JGit v5.3.0.201901162155-m1
  Fix tools/version.sh
  JGit v5.3.0.201901161700-m1

Change-Id: I3c511fbc08f21eec5bb49d443de33d43094da4a4

5 years agoMerge branch 'stable-5.2' into stable-5.3 98/137098/1
David Pursehouse [Mon, 18 Feb 2019 02:21:38 +0000 (11:21 +0900)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  ObjectDirectory: extra logging on packfile exceptions

Change-Id: I4bbeb1d28ab042e3c6c74f7284f5d882ed034305

5 years agoMerge branch 'stable-5.1' into stable-5.2 97/137097/1
David Pursehouse [Mon, 18 Feb 2019 02:20:56 +0000 (11:20 +0900)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  ObjectDirectory: extra logging on packfile exceptions

Change-Id: Id2fea30664d53b31ad026ee5ae06a5a24d731a52

5 years agoAdd missing @since tag for new API method getUpdateIndex 93/137093/3
Matthias Sohn [Sun, 17 Feb 2019 20:29:15 +0000 (21:29 +0100)]
Add missing @since tag for new API method getUpdateIndex

Change-Id: Idd4a580e241a9105a55bc6f0457ad02a35e55faf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix NPE in PlotCommitList 96/137096/1
Matthias Sohn [Mon, 18 Feb 2019 00:25:12 +0000 (01:25 +0100)]
Fix NPE in PlotCommitList

Bug: 544513
Change-Id: I2fca766bbdc441a2dca947fba5dde532de7a10fd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoCommitBuilder: Deprecate setEncoding(String) 77/136977/2
David Pursehouse [Fri, 15 Feb 2019 07:46:37 +0000 (16:46 +0900)]
CommitBuilder: Deprecate setEncoding(String)

Deprecate the method in favor of setEncoding(Charset).

Update the only caller in the code base that was still using
the deprecated variant.

Change-Id: I6357f2d0c727007013c72e9d5b7c72a3f5f3f2b1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoCommitBuilder: Add missing periods on methods' Javadoc 76/136976/2
David Pursehouse [Fri, 15 Feb 2019 07:49:28 +0000 (16:49 +0900)]
CommitBuilder: Add missing periods on methods' Javadoc

Change-Id: Ibcf64b23de8534f7831d6e40ee4b0ad2bade74ce
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoObjectDirectory: extra logging on packfile exceptions 44/136644/2
Luca Milanesio [Mon, 11 Feb 2019 07:49:43 +0000 (07:49 +0000)]
ObjectDirectory: extra logging on packfile exceptions

Display extra logging, including the exception with the associated
stacktrace, whenever a packFile can't be read and thus removed
from the packlist.

Change-Id: I97a4e31dc427bfcc0baae438dcbe2dcd4704b824
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
5 years agoUpgrade wagon-ssh to 3.3.2 66/136666/2
David Pursehouse [Mon, 11 Feb 2019 10:10:14 +0000 (19:10 +0900)]
Upgrade wagon-ssh to 3.3.2

Change-Id: I203572eb47187d476622eb416f6ac8d791b747c1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoFix bug in copyPackBypassCache's skip 'PACK' header logic 72/136872/5
Minh Thai [Wed, 13 Feb 2019 20:16:42 +0000 (12:16 -0800)]
Fix bug in copyPackBypassCache's skip 'PACK' header logic

Bug caused the pack to be 12 bytes short when cold cache.  Also added
test for copyPackAsIs method.

Change-Id: Idf8fb0e50d1215245d4b032e2e00df4b218c115f
Signed-off-by: Minh Thai <mthai@google.com>
5 years agoUpgrade spotbugs to 3.1.11 25/136225/1
David Pursehouse [Mon, 4 Feb 2019 11:15:13 +0000 (20:15 +0900)]
Upgrade spotbugs to 3.1.11

Change-Id: I24bb63fc5e1241420f6fc72e8c4708d5201c4f2b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoAtomic file creation: hard-linking may not be allowed 73/135973/2
Thomas Wolf [Tue, 29 Jan 2019 21:20:07 +0000 (22:20 +0100)]
Atomic file creation: hard-linking may not be allowed

Android for instance forbids hard linking via a SELinux
policy. If we can't hard link, the NFS work-around for
atomic file creation cannot work at all. In this case,
fall back to not using the hard-linking mechanism.

Android throws an AccessDeniedException, so we catch that.
The javadoc on Files.createLink() indicates that another
possibility might be a SecurityException, so catch that,
too.

Bug: 543956
Change-Id: I551b7a45f7b2fbbd8cf94f0b7233dbd8a200520e
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoUpdate Orbit to S20190129210011 96/135996/1
Matthias Sohn [Wed, 30 Jan 2019 09:52:38 +0000 (10:52 +0100)]
Update Orbit to S20190129210011

This is the Orbit stable build for 2019-03 M2

Change-Id: I6db8e030af6bcec9c50065cb66211280d366dfa8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix GC.deleteEmptyRefsFolders 09/135809/3
Matthias Sohn [Sun, 27 Jan 2019 01:22:34 +0000 (02:22 +0100)]
Fix GC.deleteEmptyRefsFolders

This method tried to iterate spurious files which may exist in the
.git/refs folder, e.g. on Mac a .DS_Store may have been created there by
inspecting the folder using the finder application. This led to a
NotDirectoryException when deleteEmptyRefsFolders tried to create an
iterator for such a file entry. Skip files contained in the refs folder
to ensure the method only tries to iterate contained folders but not
files.

Change-Id: I5f31e733072a35db1e93908a9c69a8891ae5c206
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoEnable cloning only specific tags 14/133814/4
Thomas Wolf [Mon, 10 Dec 2018 23:47:13 +0000 (00:47 +0100)]
Enable cloning only specific tags

Single-branch-clone should be able to clone a single tag. Enhance
CloneCommand to accept also full refs of tags in setBranchesToClone().
Make sure we also include fetch ref specs for the fetch command for
tags. This mimics the behavior of native git's single-branch clone:
git clone --branch <tag> --single-branch <URI>

Bug: 542611
Change-Id: I285cf043751d9b0ba71258ee8214c0e5d1191428
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoDelete jgit-4.5 target platform 99/135799/2
Matthias Sohn [Fri, 25 Jan 2019 23:36:12 +0000 (00:36 +0100)]
Delete jgit-4.5 target platform

Change-Id: If38b605b98cad55ee83cb7c0a6a972489031e447
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoAdd 4.11-staging target platform and update Orbit to I20190123233226 58/135658/3
Matthias Sohn [Fri, 25 Jan 2019 23:34:08 +0000 (00:34 +0100)]
Add 4.11-staging target platform and update Orbit to I20190123233226

Update
- org.apache.httpcomponents.httpcore to 4.4.10.v20190123-2214
- org.apache.httpcomponents.httpclient.source to 4.5.6.v20190123-2215
- org.bouncycastle.bcpg to 1.60.0.v20181210-2057
- org.bouncycastle.pkix to 1.60.0.v20181210-2057
- org.bouncycastle.prov to 1.60.0.v20181210-2057

Change-Id: I132b6686aa29b2a76cc529f7cae34115604c754d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpgrade jacoco-maven-plugin to 0.8.3 10/135810/1
David Pursehouse [Sun, 27 Jan 2019 07:57:15 +0000 (16:57 +0900)]
Upgrade jacoco-maven-plugin to 0.8.3

Change-Id: I1df9ed2d696613297f9e694876d94c28aaf56339
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Format BUILD file with buildifier 02/135602/2
David Pursehouse [Wed, 23 Jan 2019 08:39:48 +0000 (17:39 +0900)]
Bazel: Format BUILD file with buildifier

$ buildifier -lint=fix BUILD

Change-Id: Ie2e069db3936ce6a85c4c29e6a0137cda5e21f09
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoRenameBranchCommand: more consistent handling of short ref names 99/133599/5
Thomas Wolf [Thu, 6 Dec 2018 14:49:25 +0000 (15:49 +0100)]
RenameBranchCommand: more consistent handling of short ref names

Several problems:

* The command didn't specify whether it expected short or full names.
* For the new name, it expected a short name, but then got confused
  if tags or both local and remote branches with the same name existed.
* For the old name, it accepted either a short or a full name, but
  again got confused if a short name was given and a tag with the
  same name existed.

With such an interface, one cannot use Repository.findRef() to
reliably find the branch to rename. Use exactRef() for the new
name as by the time the Ref is needed its full name is known.
For determining the old Ref from the name, do the resolution
explicitly: first try exactRef (assuming the old name is a full
name); if that doesn't find anything, try "refs/heads/<old>" and
"refs/remotes/<old>" explicitly. Throw an exception if the name
is ambiguous, or if exactRef returned something that is not a
branch (refs/tags/... or also refs/notes/...).

Document in the javadoc what kind of names are valid, and add tests.

A user can still shoot himself in the foot if he chooses exceptionally
stupid branch names. For instance, it is still possible to rename a
branch to "refs/heads/foo" (full name "refs/heads/refs/heads/foo"),
but it cannot be renamed further using the new short name if a branch
with the full name "refs/heads/foo" exists. Similar edge cases exist
for other dumb branch names, like a branch with the short name
"refs/tags/foo". Renaming using the full name is always possible.

Bug: 542446
Change-Id: I34ac91c80c0a00c79a384d16ce1e727c550d54e9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoSshdSessionFactory: generalize providing default keys 80/134680/4
Thomas Wolf [Sat, 5 Jan 2019 16:37:25 +0000 (17:37 +0100)]
SshdSessionFactory: generalize providing default keys

Provide a mechanism for a subclass to provide its own set
of default identities from anywhere as an Iterable<KeyPair>.

The default implementation is functionally unchanged and uses
the known default identity files in the ~/.ssh directory. A subclass
can override the getDefaultKeys() function and return whatever keys
are appropriate.

Bug: 543152
Change-Id: I500d63146bc67e20e051f617790eb87c7cb500b6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoAllow to check for signing key 50/135350/4
Gunnar Wagenknecht [Fri, 18 Jan 2019 17:37:38 +0000 (09:37 -0800)]
Allow to check for signing key

The new API is intended for UIs to check if signing will be possible or
would fail

Bug: 543579
Change-Id: I6ce1fd4210e46d49dcdf420c99d08c93e022136c
Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
5 years agoHandle premature EOF in BundleFetchConnection 00/135300/4
Thomas Wolf [Thu, 17 Jan 2019 22:04:46 +0000 (23:04 +0100)]
Handle premature EOF in BundleFetchConnection

BundleFetchConnection.readLine() must abort on EOF, otherwise
it gets stuck in an endless loop.

Bug: 543390
Change-Id: I4cb3428560277888af114b928950d620bb6564f9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agopgm: Fix missing braces in Version.run() 22/135522/1
Matthias Sohn [Mon, 21 Jan 2019 22:55:08 +0000 (23:55 +0100)]
pgm: Fix missing braces in Version.run()

Change-Id: I4c5633846320f0324714f635b2be388b17cf79fa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle IOException in Version command 21/135521/1
Matthias Sohn [Mon, 21 Jan 2019 22:54:28 +0000 (23:54 +0100)]
pgm: Handle IOException in Version command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I37e6e3aaba411858042afac02098ce9eaa06f258
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in UploadPack.run() 20/135520/1
Matthias Sohn [Mon, 21 Jan 2019 22:52:57 +0000 (23:52 +0100)]
pgm: Fix missing braces in UploadPack.run()

Change-Id: I923af9b4ce62d5098828f4322a2a508bf3927bbd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle IOException in UploadPack command 19/135519/1
Matthias Sohn [Mon, 21 Jan 2019 22:52:27 +0000 (23:52 +0100)]
pgm: Handle IOException in UploadPack command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: Ife1d8e88387a32de63b0ef31f45499babdbdde3c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Tag command 18/135518/1
Matthias Sohn [Mon, 21 Jan 2019 22:48:47 +0000 (23:48 +0100)]
pgm: Handle exceptions in Tag command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I16b528fad74d0c5346d054b3c29070331d60db7f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in Status.run() 17/135517/1
Matthias Sohn [Mon, 21 Jan 2019 22:47:13 +0000 (23:47 +0100)]
pgm: Fix missing braces in Status.run()

Change-Id: Ie30df8ed3d9a1e676f130214a173b622eaf67c6f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Status command 16/135516/1
Matthias Sohn [Mon, 21 Jan 2019 22:46:37 +0000 (23:46 +0100)]
pgm: Handle exceptions in Status command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I662a343fbb46c35090bd6f840e5a35a88036a65a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in ShowRef.run() 15/135515/1
Matthias Sohn [Mon, 21 Jan 2019 22:44:55 +0000 (23:44 +0100)]
pgm: Fix missing braces in ShowRef.run()

Change-Id: I92bc2008c72bd4495dc3df47a9dd7eb242aab30f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle IOException in ShowRef command 14/135514/1
Matthias Sohn [Mon, 21 Jan 2019 22:44:20 +0000 (23:44 +0100)]
pgm: Handle IOException in ShowRef command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: If18a5d8013f1cb393af3a5e5a1ec9613ac2151bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in Show.run() 13/135513/1
Matthias Sohn [Mon, 21 Jan 2019 22:42:41 +0000 (23:42 +0100)]
pgm: Fix missing braces in Show.run()

Change-Id: I50097649f1355856e342035d54c55e65270ef507
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Show command 12/135512/1
Matthias Sohn [Mon, 21 Jan 2019 22:41:37 +0000 (23:41 +0100)]
pgm: Handle exceptions in Show command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I1c6cc5ecdc44b81e5f3f9b7dc64c3653de5475ba
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in Rm command 11/135511/1
Matthias Sohn [Mon, 21 Jan 2019 22:39:32 +0000 (23:39 +0100)]
pgm: Fix missing braces in Rm command

Change-Id: I5ad2f02516917bbd02aa0eb4fb6b05d4b06dc670
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle GitAPIException in Rm command 10/135510/1
Matthias Sohn [Mon, 21 Jan 2019 22:39:04 +0000 (23:39 +0100)]
pgm: Handle GitAPIException in Rm command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I55c15a35369e790a3ca946d6db0097a57ac6fae5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in RevParse command 09/135509/1
Matthias Sohn [Mon, 21 Jan 2019 22:36:32 +0000 (23:36 +0100)]
pgm: Handle exceptions in RevParse command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: Iae510d8c6af9acd587822a28ad48eab0b2a96ccd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Externalize error message 08/135508/1
Matthias Sohn [Mon, 21 Jan 2019 22:30:51 +0000 (23:30 +0100)]
pgm: Externalize error message

Change-Id: Id9e33104c9681dc9a57674c1648c994a503fa6b8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in Reset.run() 07/135507/1
Matthias Sohn [Mon, 21 Jan 2019 22:26:27 +0000 (23:26 +0100)]
pgm: Fix missing braces in Reset.run()

Change-Id: I1e854ab81063601eb4ff159aabc559cb65ce6ece
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle GitAPIException in Reset command 06/135506/1
Matthias Sohn [Mon, 21 Jan 2019 22:23:36 +0000 (23:23 +0100)]
pgm: Handle GitAPIException in Reset command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I70dce366081cd1fc4539cf195d6310fef1080eb3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle GitAPIException in Repo command 05/135505/1
Matthias Sohn [Mon, 21 Jan 2019 22:21:26 +0000 (23:21 +0100)]
pgm: Handle GitAPIException in Repo command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I1a636478bfae8cc0635a3e57be252126e69c19cd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Remote command 04/135504/1
Matthias Sohn [Mon, 21 Jan 2019 22:19:32 +0000 (23:19 +0100)]
pgm: Handle exceptions in Remote command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: Ie1985c2570213217c2ea0f376ff99d19bfed4e0c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Reflog command 03/135503/1
Matthias Sohn [Mon, 21 Jan 2019 22:17:00 +0000 (23:17 +0100)]
pgm: Handle exceptions in Reflog command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: Id25eb523c12c07cbd14e31edfb8b5d7ec9b3ccf3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle IOException in ReceivePack command 02/135502/1
Matthias Sohn [Mon, 21 Jan 2019 22:14:24 +0000 (23:14 +0100)]
pgm: Handle IOException in ReceivePack command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I9cecd236a8df8a2c2972d5da6031a121f25b1daa
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoSmartClientSmartServerTest: Open Repository in try-with-resource 56/135456/1
David Pursehouse [Mon, 21 Jan 2019 06:35:38 +0000 (15:35 +0900)]
SmartClientSmartServerTest: Open Repository in try-with-resource

Since 52923e9 ("LocalDiskRepositoryTestCase#createRepository: Default
auto-close to false", Jan 20, 2019) the createBareRepository method
creates repositories that do not get automatically closed in #tearDown.

Convert invocations of createBareRepository to use try-with-resource.

Change-Id: I320030c5d4438713971bee33316bff408bac47fc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSmartClientSmartServerTest: Open ObjectInserter.Formatter in try-with-resource 54/135454/1
David Pursehouse [Mon, 21 Jan 2019 06:20:25 +0000 (15:20 +0900)]
SmartClientSmartServerTest: Open ObjectInserter.Formatter in try-with-resource

Change-Id: I7005f5821394a3e237cf877cf38557b6a62cacb3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSmartClientSmartServerTest#addBrokenContext: Remove unused TestRepository 53/135453/1
David Pursehouse [Mon, 21 Jan 2019 06:17:09 +0000 (15:17 +0900)]
SmartClientSmartServerTest#addBrokenContext: Remove unused TestRepository

Change-Id: Id2b44199cda7eee7ec949d31b9029ef9325a54f4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoIO: Open TemporaryBuffer.Heap in try-with-resource 52/135452/1
David Pursehouse [Mon, 21 Jan 2019 05:19:29 +0000 (14:19 +0900)]
IO: Open TemporaryBuffer.Heap in try-with-resource

Change-Id: I78a947fd1263b47b3df17bcc6e9b32497e68dd4a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoGitSmartHttpTools: Open SideBandOutputStream in try-with-resource 51/135451/1
David Pursehouse [Mon, 21 Jan 2019 05:02:02 +0000 (14:02 +0900)]
GitSmartHttpTools: Open SideBandOutputStream in try-with-resource

Change-Id: Ie7c17f98579e7241f2b5c8204435c76686eeb568
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoTemporaryBufferTest: Open TemporaryBuffer in try-with-resource 50/135450/1
David Pursehouse [Mon, 21 Jan 2019 04:57:46 +0000 (13:57 +0900)]
TemporaryBufferTest: Open TemporaryBuffer in try-with-resource

Except the cases where the warning was suppressed in bf757cd because
they are explicitly testing functionality that is not possible in t-w-r.

Change-Id: I6c66eb31a2314028e09a9213dc695cd163f907e9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoScanner: Open RevWalk in try-with-resource 49/135449/1
David Pursehouse [Mon, 21 Jan 2019 04:45:58 +0000 (13:45 +0900)]
Scanner: Open RevWalk in try-with-resource

Change-Id: Ieeec292c1346edbda2b26f021e75cbc1435bb9f9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSubmoduleWalkTest: Open Repository in try-with-resource 48/135448/1
David Pursehouse [Mon, 21 Jan 2019 04:40:48 +0000 (13:40 +0900)]
SubmoduleWalkTest: Open Repository in try-with-resource

Change-Id: I9c4ee4e4c55f48db1f21e18b212657e4dd3de053
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoSideBandOutputStreamTest: Open SideBandOutputStream in try-with-resource 47/135447/1
David Pursehouse [Mon, 21 Jan 2019 04:36:31 +0000 (13:36 +0900)]
SideBandOutputStreamTest: Open SideBandOutputStream in try-with-resource

Change-Id: I34041a556a5a83afcd0c1bab00e5d8088c30ea3f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoUnionInputStreamTest: Open UnionInputStream in try-with-resource 46/135446/1
David Pursehouse [Mon, 21 Jan 2019 04:28:22 +0000 (13:28 +0900)]
UnionInputStreamTest: Open UnionInputStream in try-with-resource

The tests were written for Java 7 which did not have AutoCloseable
and the try-with-resource concept. When the project was updated to
build with Java 8, the warnings were suppressed.

Remove the suppressions and convert to use try-with-resource.

Change-Id: Ic805bd571c4a2e4376ce5e7c34ca7ac86cbf5104
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge: Avoid non-localised literal string warning for "recursive" 45/135445/1
David Pursehouse [Sun, 20 Jan 2019 23:12:19 +0000 (08:12 +0900)]
Merge: Avoid non-localised literal string warning for "recursive"

Instead of using the literal string, take the name from the RECURSIVE
enum value.

Change-Id: I9d8f289232dfc8f784287029c41714ddbdee232b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agopgm: Fix missing braces in Push.run() 41/135441/2
Matthias Sohn [Sun, 20 Jan 2019 20:54:27 +0000 (21:54 +0100)]
pgm: Fix missing braces in Push.run()

Change-Id: I7cc1b3ca022ba131c196d72c1b776de942442b7f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Push command 40/135440/2
Matthias Sohn [Sun, 20 Jan 2019 20:53:30 +0000 (21:53 +0100)]
pgm: Handle exceptions in Push command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I7a5dc6b1ebaad6f7b8baa35ce68760b79bab8acd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in MergeBase.run() 39/135439/2
Matthias Sohn [Sun, 20 Jan 2019 20:51:09 +0000 (21:51 +0100)]
pgm: Fix missing braces in MergeBase.run()

Change-Id: I625053ceb5a81bc0014f7cab0f9fb5e5deaacc36
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle IOException in MergeBase command 38/135438/2
Matthias Sohn [Sun, 20 Jan 2019 20:49:21 +0000 (21:49 +0100)]
pgm: Handle IOException in MergeBase command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I5f198f71adfbb43ec1af26285658a5d5bdfa1904
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in Merge command 37/135437/2
Matthias Sohn [Sun, 20 Jan 2019 20:48:09 +0000 (21:48 +0100)]
pgm: Fix missing braces in Merge command

Change-Id: I39495d832ff4e48a97182faef88871902d3edb11
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in Merge command 36/135436/2
Matthias Sohn [Sun, 20 Jan 2019 20:46:09 +0000 (21:46 +0100)]
pgm: Handle exceptions in Merge command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: I7afd038d8def9d2f409c0ed297b9db8ea2fc75c1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in LsTree.run() 35/135435/2
Matthias Sohn [Sun, 20 Jan 2019 20:37:38 +0000 (21:37 +0100)]
pgm: Fix missing braces in LsTree.run()

Change-Id: Iac1755c2ec8094cd211bbc9f1d819cc8052e20cb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Handle exceptions in LsTree command 34/135434/2
Matthias Sohn [Sun, 20 Jan 2019 20:37:04 +0000 (21:37 +0100)]
pgm: Handle exceptions in LsTree command

This avoids we show a stacktrace on the console by default when this
type of exception is thrown during the run method is executed.

Change-Id: Ib3ae59eeb90143eca1a0b515c59457a0eb2cc383
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agopgm: Fix missing braces in LsRemote.run() 33/135433/2
Matthias Sohn [Sun, 20 Jan 2019 20:34:40 +0000 (21:34 +0100)]
pgm: Fix missing braces in LsRemote.run()

Change-Id: I779a6c28f7e8c4ba0527eb872454fd2cc3d81304
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>