]> source.dussan.org Git - jgit.git/log
jgit.git
5 years agoCachedPackUriProvider: Add size to the pack information 60/150860/3
Ivan Frade [Wed, 9 Oct 2019 21:10:14 +0000 (14:10 -0700)]
CachedPackUriProvider: Add size to the pack information

The object identifying packfiles to send them via packfile-uri contains
only the uri and the hash. This is the information that goes through the
wire. It would be useful to know also the size of those packfile, for
example to track how many bytes have been offloaded to HTTP.

Add size field the CachedPackUriProvider.PackInfo object.

Change-Id: If6b921b48a4764d936141c777879b148cc80bbd3
Signed-off-by: Ivan Frade <ifrade@google.com>
5 years agoMerge changes Ieebbd671,I0e3e9456,Ia8d72e31
Terry Parker [Wed, 9 Oct 2019 19:55:48 +0000 (15:55 -0400)]
Merge changes Ieebbd671,I0e3e9456,Ia8d72e31

* changes:
  UploadPack: Create a method that propagates an exception as-is
  UploadPack: Consolidate the sideband handling code to one place
  UploadPack: Introduce ErrorWriter

5 years agoUploadPack: Create a method that propagates an exception as-is 43/147143/8
Masaya Suzuki [Tue, 6 Aug 2019 18:12:43 +0000 (11:12 -0700)]
UploadPack: Create a method that propagates an exception as-is

Exception handling can be isolated from UploadPack. This makes it
possible to make the exception handler pluggable.

Change-Id: Ieebbd6711963c7f2e47a98783b4ad815793721c7
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
5 years agoUploadPack: Consolidate the sideband handling code to one place 26/146526/9
Masaya Suzuki [Tue, 23 Jul 2019 17:36:14 +0000 (10:36 -0700)]
UploadPack: Consolidate the sideband handling code to one place

This consolidates the sideband stream creation code and the error
handling code for the sideband-allowed part in the Git protocol to one
place.

Change-Id: I0e3e94564f50d1be32006f9d8bcd1ef1ce6bf07e
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
5 years agoUploadPack: Introduce ErrorWriter 27/146527/9
Masaya Suzuki [Tue, 23 Jul 2019 18:10:24 +0000 (11:10 -0700)]
UploadPack: Introduce ErrorWriter

ErrorWriter writes an error message to the user. The implementation is
swapped once it detects that the client supports sideband. By default it
uses the protocol level ERR packet, which was introduced recently.

In total the error output is done in two different places;
UploadPack#upload and UploadPack#sendPack. These will be consolidated in
the next change.

Change-Id: Ia8d72e31170bbeafc8ffa8ddb92702196af8a587
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
5 years agoApache HTTP: support proxy authentication 73/150173/2
Thomas Wolf [Sun, 11 Aug 2019 20:46:44 +0000 (22:46 +0200)]
Apache HTTP: support proxy authentication

Add a credentials provider that forwards to the java.net.Authenticator.
Needed to support proxies requiring authentication.

Bug: 549832
Change-Id: I181ee27a6c9f1b3fa402ce58affdd5ff3f7c96c9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoProtocolV2Parser: Add missing $NON-NLS suppression 66/150666/2
David Pursehouse [Mon, 7 Oct 2019 01:03:08 +0000 (10:03 +0900)]
ProtocolV2Parser: Add missing $NON-NLS suppression

Change-Id: If0a6eb9829a4790073f1c9baa2cfe39cb43f7d84
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoUploadPackTest: Stop using deprecated PacketLineIn constants 65/150665/2
David Pursehouse [Mon, 7 Oct 2019 00:50:40 +0000 (09:50 +0900)]
UploadPackTest: Stop using deprecated PacketLineIn constants

The DELIM and END constants are deprecated and using them causes
warnings. Replace them with the accessor methods.

Change-Id: Iadb27000755e8fd8c61d9218591f9d110b8265c8
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoFix parsing of core.logAllRefUpdates 04/150504/4
Thomas Wolf [Wed, 2 Oct 2019 15:33:43 +0000 (17:33 +0200)]
Fix parsing of core.logAllRefUpdates

Also correctly parse the "always" value (allowed in canonical git
since git 2.12.0[1]). Adapt the ReflogWriter.

[1] https://github.com/git/git/commit/341fb2862

Bug: 551664
Change-Id: I051c76ca355a2ac8d6092de65f44b18bf9aeb125
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoUpdate Jetty to 9.4.21.v20190926 22/150622/1
Matthias Sohn [Fri, 4 Oct 2019 20:21:35 +0000 (22:21 +0200)]
Update Jetty to 9.4.21.v20190926

Change-Id: If01a01015024db9743c38c59f920964b3c3a0539
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoCreate 4.14 staging target platform 21/150621/1
Matthias Sohn [Fri, 4 Oct 2019 20:34:55 +0000 (22:34 +0200)]
Create 4.14 staging target platform

Change-Id: I6d8a6a0af41775a40342d56665cbd4e2e4aa5c61
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge "Merge branch 'stable-5.5'"
Matthias Sohn [Fri, 4 Oct 2019 19:42:20 +0000 (15:42 -0400)]
Merge "Merge branch 'stable-5.5'"

5 years agoFix NPE in DfsPackCompactor.compactReftables 11/150611/1
Minh Thai [Fri, 4 Oct 2019 08:02:52 +0000 (01:02 -0700)]
Fix NPE in DfsPackCompactor.compactReftables

Output pack description needs to be initialized.

Change-Id: I4b66a18fa7020f528b312bc9f74b8d094ad6ad66
Signed-off-by: Minh Thai <mthai@google.com>
5 years agoMerge branch 'stable-5.5' 66/150566/1
Matthias Sohn [Thu, 3 Oct 2019 21:23:30 +0000 (23:23 +0200)]
Merge branch 'stable-5.5'

* stable-5.5:
  Prepare 5.5.2-SNAPSHOT builds
  JGit v5.5.1.201910021850-r
  Prepare 5.3.7-SNAPSHOT builds
  JGit v5.3.6.201910020505-r
  Prepare 5.1.13-SNAPSHOT builds
  JGit v5.1.12.201910011832-r
  Do not rely on ArrayIndexOutOfBoundsException to detect end of input

Change-Id: Iabebdc4786b52ec678caa798975428fda4ad7bd7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.5.2-SNAPSHOT builds 25/150525/1
Matthias Sohn [Thu, 3 Oct 2019 00:06:57 +0000 (02:06 +0200)]
Prepare 5.5.2-SNAPSHOT builds

Change-Id: Ief9940182fd6e3f3e2df88e6485be753c1260e6b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.5.1.201910021850-r 23/150523/1 v5.5.1.201910021850-r
Matthias Sohn [Wed, 2 Oct 2019 22:49:02 +0000 (00:49 +0200)]
JGit v5.5.1.201910021850-r

Change-Id: I9930b35b095f638119b4601a8311257daf5e5420
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.4' into stable-5.5 22/150522/1
Matthias Sohn [Wed, 2 Oct 2019 22:47:05 +0000 (00:47 +0200)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Prepare 5.3.7-SNAPSHOT builds
  JGit v5.3.6.201910020505-r
  Prepare 5.1.13-SNAPSHOT builds
  JGit v5.1.12.201910011832-r
  Do not rely on ArrayIndexOutOfBoundsException to detect end of input

Change-Id: Ia1070fd170651ce827bc6b876c6764a44ffe60eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.3' into stable-5.4 13/150513/1
Matthias Sohn [Wed, 2 Oct 2019 09:36:05 +0000 (11:36 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Prepare 5.3.7-SNAPSHOT builds
  JGit v5.3.6.201910020505-r
  Prepare 5.1.13-SNAPSHOT builds
  JGit v5.1.12.201910011832-r
  Do not rely on ArrayIndexOutOfBoundsException to detect end of input

Change-Id: Ia621d06a9489ee276c793de9dd4a77f4ff19e2ac
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.3.7-SNAPSHOT builds 12/150512/1
Matthias Sohn [Wed, 2 Oct 2019 09:23:28 +0000 (11:23 +0200)]
Prepare 5.3.7-SNAPSHOT builds

Change-Id: I3465b6a4d913bfb2864abba58448423e7c262f60
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.3.6.201910020505-r 83/150483/1 v5.3.6.201910020505-r
Matthias Sohn [Wed, 2 Oct 2019 09:03:41 +0000 (11:03 +0200)]
JGit v5.3.6.201910020505-r

Change-Id: I12d1c6af03f2d7474c99c22cd2aabb77e95fcb32
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 81/150481/2
Matthias Sohn [Wed, 2 Oct 2019 08:59:34 +0000 (10:59 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Prepare 5.1.13-SNAPSHOT builds
  JGit v5.1.12.201910011832-r
  Do not rely on ArrayIndexOutOfBoundsException to detect end of input

Change-Id: I3f11a83e177daefa0a2e91173f70f9547067f713
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 80/150480/1
Matthias Sohn [Wed, 2 Oct 2019 08:56:15 +0000 (10:56 +0200)]
Merge branch 'stable-5.1' into stable-5.2

# By Matthias Sohn (2) and Saša Živkov (1)
* stable-5.1:
  Prepare 5.1.13-SNAPSHOT builds
  JGit v5.1.12.201910011832-r
  Do not rely on ArrayIndexOutOfBoundsException to detect end of input

Change-Id: Iaae4b171eaa0081f9142489de8df94ab455d65f7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.1.13-SNAPSHOT builds 62/150462/1
Matthias Sohn [Tue, 1 Oct 2019 22:40:49 +0000 (00:40 +0200)]
Prepare 5.1.13-SNAPSHOT builds

Change-Id: Ic1dca14924f49ad07eb5cd0570ce7ece9f319d0d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.1.12.201910011832-r 61/150461/1 v5.1.12.201910011832-r
Matthias Sohn [Tue, 1 Oct 2019 22:32:04 +0000 (00:32 +0200)]
JGit v5.1.12.201910011832-r

Change-Id: I69fef9b2cdc18bbf1c8b9b290fb3d190684be13c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoRename servlet-api-3_1 to match Gerrit master 49/150449/3
Luca Milanesio [Tue, 1 Oct 2019 17:01:22 +0000 (18:01 +0100)]
Rename servlet-api-3_1 to match Gerrit master

JGit is built from source on Gerrit-CI: the Bazel build
dependencies need to be aligned. On Gerrit master the servlet-api-3_1
is renamed to servlet-api (see [1]): do the same on the JGit master
branch.

In addition, removing the version suffix from dependency rule makes
it much easier to upgrade. The actual reason the for the renaming it
in Gerrit core is upgrade attempt to servlet-api 4.0, done in [2].

[1] https://gerrit-review.googlesource.com/c/gerrit/+/238496
[2] https://gerrit-review.googlesource.com/c/gerrit/+/238383

Change-Id: I63c506da335deef54eb279879e897b427200797b
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
5 years agoreftable: move AutoCloseable to ReftableReader 41/150141/5
Han-Wen Nienhuys [Wed, 25 Sep 2019 17:01:26 +0000 (19:01 +0200)]
reftable: move AutoCloseable to ReftableReader

MergedReftable is not used as an AutoCloseable, because closing tables
is currently handled by DfsReftableStack#close.

Encode that a MergedReftable is a list of ReftableReaders. The previous
code suggested that we could form nested trees of MergedReftables,
which is not how we use reftables.

Change-Id: Icbe2fee8a5a12373f45fc5f97d8b1a2b14231c96
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoDo not rely on ArrayIndexOutOfBoundsException to detect end of input 54/150254/1
Saša Živkov [Fri, 27 Sep 2019 13:58:10 +0000 (15:58 +0200)]
Do not rely on ArrayIndexOutOfBoundsException to detect end of input

In the Config#StringReader we relied on ArrayIndexOutOfBoundsException
to detect the end of the input. Creation of exception with (deep) stack
trace can significantly degrade performance in case when we read
thousands of config files, like in the case when Gerrit reads all
external ids from the NoteDb.

Use the buf.length to detect the end of the input.

Change-Id: I12266f25751373a870ce3fa623cf2a95d882d521

5 years agoAdd missing braces in CherryPickCommand 31/150031/2
Matthias Sohn [Mon, 23 Sep 2019 22:16:32 +0000 (00:16 +0200)]
Add missing braces in CherryPickCommand

Change-Id: I4b038ba7f86a45eb52422d3c2b4c4fc30ea16362
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFire WorkingTreeModifiedEvent if cherry-pick failed with conflicts 30/150030/4
Matthias Sohn [Mon, 23 Sep 2019 22:14:12 +0000 (00:14 +0200)]
Fire WorkingTreeModifiedEvent if cherry-pick failed with conflicts

Otherwise the paths modified by a cherry-pick with conflicts won't be
reported as modified via WorkingTreeModifiedEvents.

Change-Id: I875b67c0d2f68efdf90a9c32b80a2e074ed3570d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoMerge "Documentation/technical/reftable: document rename in reflog."
Jonathan Tan [Wed, 25 Sep 2019 17:20:01 +0000 (13:20 -0400)]
Merge "Documentation/technical/reftable: document rename in reflog."

5 years agoMerge "Update Eclipse SUA to latest 2.0 version"
David Pursehouse [Tue, 24 Sep 2019 23:44:12 +0000 (19:44 -0400)]
Merge "Update Eclipse SUA to latest 2.0 version"

5 years agoMerge "reftable: pass OutputStream at construction time"
Jonathan Tan [Tue, 24 Sep 2019 18:33:38 +0000 (14:33 -0400)]
Merge "reftable: pass OutputStream at construction time"

5 years agoUpdate Eclipse SUA to latest 2.0 version 49/150049/1
Matthias Sohn [Tue, 24 Sep 2019 10:15:52 +0000 (12:15 +0200)]
Update Eclipse SUA to latest 2.0 version

This should fix errors raised in
https://download.eclipse.org/oomph/archive/simrel/egit.aggrcon/

The original is maintained in
https://git.eclipse.org/r/plugins/gitiles/cbi/org.eclipse.license/+/refs/heads/master/org.eclipse.license

Change-Id: I09325f04f3ae13b2558b212ad73b3f4f624ecb8d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoBump bazel version to 0.29.1 65/149965/2
David Ostrovsky [Mon, 23 Sep 2019 07:11:17 +0000 (09:11 +0200)]
Bump bazel version to 0.29.1

Change-Id: I55033c5f36bc2371763e385d7289e9ccf967c32e
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
5 years agoBazel: Reuse version from .bazelversion for minimum used version check 66/149966/1
David Ostrovsky [Mon, 23 Sep 2019 07:20:41 +0000 (09:20 +0200)]
Bazel: Reuse version from .bazelversion for minimum used version check

Bazel is still supported in addition to the Bazel wrapper Bazelisk,
that is recommended, as it would automatically switch to the right
Bazel version on stable branches (like it was the case with Buck).

That why minimum used Bazel version check is still needed in WORKSPACE
file in addition to the .bazelversion used by Bazelisk. That means that
currently, bazel version is maintained in two places:

* .bazelversion
* WORKSPACE

This change introduces the repository rule to read the bazel version
from the .bazelversion file and perform the minimum version check.

Change-Id: Ib9c1382935ded7bcd322ed0122838c40ba2faa6c
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
5 years agoreftable: pass OutputStream at construction time 62/149762/6
Han-Wen Nienhuys [Wed, 18 Sep 2019 13:18:51 +0000 (15:18 +0200)]
reftable: pass OutputStream at construction time

This makes the intended use of the classes more clear. It also
simplifies generic functions that write reftables: they only need a
ReftableWriter as argument, as the stream is carried within the
ReftableWriter.

Change-Id: Idbb06f89ae33100f0c0b562cc38e5b3b026d5181
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agodfs: rename ReftableStack to DfsReftableStack 66/146566/28
Han-Wen Nienhuys [Wed, 24 Jul 2019 15:26:44 +0000 (17:26 +0200)]
dfs: rename ReftableStack to DfsReftableStack

The functionality in ReftableStack is specific to DFS.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: If6003d104b1ecb0f3ca7e9c3815b233fa0abf077

5 years agoreftable: add maxUpdateIndex to Reftable 70/149170/9
Han-Wen Nienhuys [Sun, 8 Sep 2019 16:02:05 +0000 (18:02 +0200)]
reftable: add maxUpdateIndex to Reftable

This makes maxUpdateIndex() available in MergedReftable, so we can
know generically at which index to create the next reftable in a
stack.

Change-Id: Ia2314bc57c8b5dd7e69d5e61096fdce1d35abd11
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoUpgrade ecj plugin to 3.19.0 39/149839/1
David Pursehouse [Thu, 19 Sep 2019 12:43:18 +0000 (21:43 +0900)]
Upgrade ecj plugin to 3.19.0

Change-Id: I36854a4e27ad3b0fc6c2ac145d78df582bca3988
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoUploadPackReachabilityTest: Use assertThrows instead of thrown 06/149806/1
Ivan Frade [Wed, 18 Sep 2019 21:38:37 +0000 (14:38 -0700)]
UploadPackReachabilityTest: Use assertThrows instead of thrown

In https://git.eclipse.org/r/c/144009/ UploadPack tests moved from
thrown to assertThrows, but newly introduced tests are still using
the thrown.

Update test so all of them use assertThrows.

Change-Id: I0ff19a6f8ba9e978d8ffc7a912c0572d9f00c7fa
Signed-off-by: Ivan Frade <ifrade@google.com>
5 years agoRequestValidatorTestCase: Tests for the request validators 22/141922/4
Ivan Frade [Thu, 9 May 2019 23:19:06 +0000 (16:19 -0700)]
RequestValidatorTestCase: Tests for the request validators

Make a general test with all the cases, like request
advertised/unadvertised tips, reachable/unreachable from those tips,
commits/blobs.

Implement specific validator tests as subclasses. Each test provides the
validator instance and tells what cases are valid.

Change-Id: I7f961fcc05f7fabbeae1ba8ff73d99072ce8fc72
Signed-off-by: Ivan Frade <ifrade@google.com>
5 years agoUploadPackTest: Move "reachability" tests to its own file 21/141921/3
Ivan Frade [Thu, 9 May 2019 23:15:24 +0000 (16:15 -0700)]
UploadPackTest: Move "reachability" tests to its own file

UploadPackTest is already too long and it is covering too many aspects
of UploadPack. This makes difficult to see what is tests and if all
cases are covered.

Move the reachability-related tests to its own file. This moves also an
auxiliary function, reducing the length of UploadPack. Complete also the
coverage, adding combinations of bitmap availability/commits or
blobs/reachable or not.

Change-Id: Id5cfc9d0118d997da30e3886c91db996a86250fc
Signed-off-by: Ivan Frade <ifrade@google.com>
5 years agoMerge branch 'stable-5.5' 21/149621/1
Matthias Sohn [Mon, 16 Sep 2019 22:42:26 +0000 (00:42 +0200)]
Merge branch 'stable-5.5'

* stable-5.5:
  WorkingTreeIterator: handle different timestamp resolutions

Change-Id: I61df7392d8826ab526c39da2a8718723a1cc602a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.4' into stable-5.5 20/149620/1
Matthias Sohn [Mon, 16 Sep 2019 22:41:28 +0000 (00:41 +0200)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  WorkingTreeIterator: handle different timestamp resolutions

Change-Id: I83384336e0d766237d0579152673c9eefc9edd65
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.3' into stable-5.4 19/149619/1
Matthias Sohn [Mon, 16 Sep 2019 22:40:42 +0000 (00:40 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  WorkingTreeIterator: handle different timestamp resolutions

Change-Id: I87afe29578b0270c79bc54c4e2cfda579c329237
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 18/149618/1
Matthias Sohn [Mon, 16 Sep 2019 22:39:45 +0000 (00:39 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  WorkingTreeIterator: handle different timestamp resolutions

Change-Id: Ia2a38949089a66abb5f4f1cd41717d2ae8d0eb5b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 17/149617/1
Matthias Sohn [Mon, 16 Sep 2019 22:38:16 +0000 (00:38 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  WorkingTreeIterator: handle different timestamp resolutions

Change-Id: Ic33ebec963af03a182dfe8f46486f5e8d00c0694
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoWorkingTreeIterator: handle different timestamp resolutions 40/149440/6
Thomas Wolf [Thu, 12 Sep 2019 19:05:19 +0000 (21:05 +0200)]
WorkingTreeIterator: handle different timestamp resolutions

Older JGit stored only milliseconds timestamps in the index. Newer
JGit may get finer timestamps from the file system. This leads to
slow index diffs when a new JGit runs against an index produced
by older JGit because many timestamps will differ and JGit will
then do many content checks. See [1].

Handle this migration case by only comparing milliseconds if the
index entry has only millisecond precision.

The inverse may also occur; also compare only milliseconds if the
file timestamp has only millisecond precision.

Do the same also for microsecond resolution. On Windows, NTFS may
provide 100ns resolution and may be used by external programs writing
the index, but Java's WindowsFileAttributes may provide only
microseconds.

File timestamp precision in Java depends not only on the Java APIs
used by different JGit versions but may also change when running the
same Java code on different VMs. And of course the resolution may
vary among operating and file systems. Moreover, timestamp precision
in the index depends on the program that wrote the index. Canonical
git may use a different resolution, maybe even different between git
versions.

[1] https://www.eclipse.org/forums/index.php/t/1100344/

Change-Id: Idfd08606c883cb98787b2138f9baf0cc89a57b56
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpgrade eclipse-jarsigner-plugin to 1.1.7 06/147406/2
David Pursehouse [Sat, 10 Aug 2019 02:59:34 +0000 (11:59 +0900)]
Upgrade eclipse-jarsigner-plugin to 1.1.7

Change-Id: I1ed3a3a09b63eece30bba90b76579797aa4f589d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoRequire Maven version 3.6.2 56/149456/1
David Pursehouse [Fri, 13 Sep 2019 08:03:23 +0000 (17:03 +0900)]
Require Maven version 3.6.2

Change-Id: I3acfe4be7a427eff0eb057a2e22253030bb0e910
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoRemove an old work-around for core.autocrlf = input 90/149390/3
Thomas Wolf [Wed, 11 Sep 2019 19:55:53 +0000 (21:55 +0200)]
Remove an old work-around for core.autocrlf = input

The removed code was trying to avoid mistakenly reporting differences
when core.autocrlf was set to "input" but a file had already been
committed with CR-LF. It did that by running the blob from the cache
through a CRLF-to-LF filter because older JGit would also run the file
from the working tree through such a filter.

The real fix for this case was done in commit 60cf85a. Since then files
are not normalized if they have already been committed with CR-LF and
this old fix attempt from bug 372834 is no longer needed.

Change-Id: Ib4facc153d81325cb48b4ee956a596b423f36241
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
5 years agoMerge "Merge branch 'stable-5.5'"
David Pursehouse [Thu, 12 Sep 2019 00:53:11 +0000 (20:53 -0400)]
Merge "Merge branch 'stable-5.5'"

5 years agoMerge branch 'stable-5.5' 82/149382/1
Matthias Sohn [Wed, 11 Sep 2019 20:18:51 +0000 (22:18 +0200)]
Merge branch 'stable-5.5'

* stable-5.5:
  Prepare 5.5.1-SNAPSHOT builds
  JGit v5.5.0.201909110433-r
  Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

Change-Id: I113ce255739786623f7e101dc293b9a769abeff0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agodfs: use ReftableConfig() constructor in DfsReftableDatabase 65/146565/23
Han-Wen Nienhuys [Wed, 24 Jul 2019 15:22:43 +0000 (17:22 +0200)]
dfs: use ReftableConfig() constructor in DfsReftableDatabase

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I756f086fccaba8e77db516160c14708f97519f93

5 years agodfs: use RefDatabase API for exactRef in ReftableBatchRefUpdate 47/146447/25
Han-Wen Nienhuys [Sun, 21 Jul 2019 20:24:56 +0000 (22:24 +0200)]
dfs: use RefDatabase API for exactRef in ReftableBatchRefUpdate

This removes one use of DFS specific code in this class.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I3ef6a4b98357cc6dc480892244ddc51d2fd751a2

5 years agoreftable: add OutputStream argument to ReftableWriter constructor 58/148358/10
Han-Wen Nienhuys [Mon, 26 Aug 2019 14:38:39 +0000 (16:38 +0200)]
reftable: add OutputStream argument to ReftableWriter constructor

This lets us write reftables generically with functions that take
just ReftableWriter argument

Change-Id: I7285951f62f9bd4c78e8f0de194c077d51fa4e51
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoreftable: read file footer in ReftableReader#allRefs 69/149169/5
Han-Wen Nienhuys [Mon, 9 Sep 2019 13:07:25 +0000 (15:07 +0200)]
reftable: read file footer in ReftableReader#allRefs

allRefs determined the end of the ref block without accounting for
index or log blocks. This could cause other blocks to be interpreted
as ref blocks, leading to "invalid block" error messages.

Change-Id: I7b9323e7d5e0e7d64535b3ec1efd576aed1e9870
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoreftable: add ReftableReflogReader 65/147565/20
Han-Wen Nienhuys [Mon, 12 Aug 2019 17:04:07 +0000 (19:04 +0200)]
reftable: add ReftableReflogReader

Change-Id: Iac2c4ac5e3aad0fa37157ed8866f1987d80268d6
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
5 years agoPrepare 5.5.1-SNAPSHOT builds 51/149351/1
Matthias Sohn [Wed, 11 Sep 2019 09:46:58 +0000 (11:46 +0200)]
Prepare 5.5.1-SNAPSHOT builds

Change-Id: Iaf929168770dfef54ce2a7bfcbee9b87c450ca8a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.5.0.201909110433-r 30/149330/1 v5.5.0.201909110433-r
Matthias Sohn [Wed, 11 Sep 2019 08:31:38 +0000 (10:31 +0200)]
JGit v5.5.0.201909110433-r

Change-Id: I5715730ac47d32462f235c2f50581bf1579d46b9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.4' into stable-5.5 92/149292/2
Matthias Sohn [Tue, 10 Sep 2019 20:03:06 +0000 (22:03 +0200)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

Change-Id: Ibdda7687da015b17cdca67427202766fe102fee1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.3' into stable-5.4 99/149299/1
Matthias Sohn [Tue, 10 Sep 2019 19:27:06 +0000 (21:27 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

Change-Id: Ie8447fc28b03bfc918cee0cc2162a2aa3585f3ea
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 90/149290/1
Matthias Sohn [Tue, 10 Sep 2019 19:26:31 +0000 (21:26 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

Change-Id: I57093dfef181645088767471159c204c50961c3a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 89/149289/1
Matthias Sohn [Tue, 10 Sep 2019 19:25:45 +0000 (21:25 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

Change-Id: Ic4ee37fb36f61dc7707391f768bf78a33094bfd3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL 66/149266/1
Matthias Sohn [Tue, 10 Sep 2019 14:08:45 +0000 (16:08 +0200)]
Fix WorkingTreeIterator.compareMetadata() for CheckStat.MINIMAL

If CheckStat is MINIMAL or timestamps have no nanosecond part
WorkingTreeIterator.compareMetaData only checks the second part of
timestamps and ignores nanoseconds which may have ended up in the index
by using native git.

If

fileLastModified.getEpochSecond() == cacheLastModified.getEpochSecond()

we currently proceed comparing fileLastModified and cacheLastModified
with full precision which is wrong since we determined that we detected
reduced timestamp resolution.

Fix this and also handle smudged index entries for CheckStat.MINIMAL.

Change-Id: I6149885903ac63d79b42d234cc02aa4e19578f3c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.5' 07/149107/5
Matthias Sohn [Sun, 8 Sep 2019 15:36:59 +0000 (17:36 +0200)]
Merge branch 'stable-5.5'

* stable-5.5:
  bazel: fix running http tests
  Set parameter name in parameterized http tests
  Format BUILD files with buildifier
  Format BUILD files with buildifier
  [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache
  Bazel: Format BUILD files with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Fix warning about deprecated lib.bzl
  Format lib/BUILD with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Bump minimum supported version to 0.29.0
  Bazel: Bump skylib library version to 0.8.0
  Use bazelisk to switch between used bazel version
  Bazel: Require minimum bazel version 0.17.1
  Fix wrong placeholder index in error message packInaccessible
  JGitText: Remove unused externalized strings
  RepoText: Remove unused externalized string
  CLI: Remove unused externalized strings

Change-Id: Idb0848dd33a76328b24908dc86db335cca742a1c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.4' into stable-5.5 06/149106/6
Matthias Sohn [Sun, 8 Sep 2019 15:35:14 +0000 (17:35 +0200)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Format BUILD files with buildifier
  Format BUILD files with buildifier
  [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache
  Bazel: Format BUILD files with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Fix warning about deprecated lib.bzl
  Format lib/BUILD with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Bump minimum supported version to 0.29.0
  Bazel: Bump skylib library version to 0.8.0
  Use bazelisk to switch between used bazel version
  Bazel: Require minimum bazel version 0.17.1
  Fix wrong placeholder index in error message packInaccessible
  JGitText: Remove unused externalized strings
  RepoText: Remove unused externalized string
  CLI: Remove unused externalized strings

Change-Id: Idf3abd80ad3b00188f655e638d9908228770911f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agobazel: fix running http tests 21/149121/5
Matthias Sohn [Sun, 8 Sep 2019 11:34:21 +0000 (13:34 +0200)]
bazel: fix running http tests

Other than Maven bazel seems unable to cope with abstract
AllFactoriesHttpTestCase having no test methods, hence tag this class
with @Ignore.

Change-Id: I9dfe43f882ad073b284648e24844b51877d87776
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoSet parameter name in parameterized http tests 20/149120/2
Matthias Sohn [Sun, 8 Sep 2019 10:34:27 +0000 (12:34 +0200)]
Set parameter name in parameterized http tests

This shows the class name of the HTTP factory used in each test run.

Change-Id: I7c1df20f0e138dc7e3120fe87e80d40ab17dd8c8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.3' into stable-5.4 26/149126/1
Matthias Sohn [Sun, 8 Sep 2019 15:10:52 +0000 (17:10 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Format BUILD files with buildifier

Change-Id: Iaf15196f31ec839fed4211d099bed991b4e5e9de
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 25/149125/1
Matthias Sohn [Sun, 8 Sep 2019 15:10:03 +0000 (17:10 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  Format BUILD files with buildifier

Change-Id: I9281a953a38dad0df7e5a2d6d7a11d4597513aa1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 24/149124/1
Matthias Sohn [Sun, 8 Sep 2019 15:08:39 +0000 (17:08 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Format BUILD files with buildifier

Change-Id: I5a8413470fd0fbb6db3ca553f455b3e3dc10ab33
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFormat BUILD files with buildifier 23/149123/1
David Pursehouse [Sun, 8 Sep 2019 13:30:19 +0000 (22:30 +0900)]
Format BUILD files with buildifier

Using buildifier from master branch and the command:

$ buildifier -r -lint fix -warnings all .

Change-Id: I19c8ff183081093cb73bed7221a78a91b6cba4dc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.3' into stable-5.4 05/149105/4
Matthias Sohn [Sun, 8 Sep 2019 13:05:19 +0000 (15:05 +0200)]
Merge branch 'stable-5.3' into stable-5.4

* stable-5.3:
  Format BUILD files with buildifier
  [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache
  Bazel: Format BUILD files with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Fix warning about deprecated lib.bzl
  Format lib/BUILD with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Bump minimum supported version to 0.29.0
  Bazel: Bump skylib library version to 0.8.0
  Use bazelisk to switch between used bazel version
  Bazel: Require minimum bazel version 0.17.1
  Fix wrong placeholder index in error message packInaccessible
  JGitText: Remove unused externalized strings
  RepoText: Remove unused externalized string
  CLI: Remove unused externalized strings

Change-Id: Iaea77a89fcd821df5dbb24f5e3e39e6d1dfc0bd4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoFormat BUILD files with buildifier 16/149116/2
Matthias Sohn [Sun, 8 Sep 2019 12:59:29 +0000 (14:59 +0200)]
Format BUILD files with buildifier

Using buildifier from master branch and the command:
$ buildifier -r -lint fix -warnings all .

Change-Id: I52a18c09a1f192e2141f4156f9c1aabbbdbc910a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.2' into stable-5.3 02/149102/5
Matthias Sohn [Sun, 8 Sep 2019 09:17:32 +0000 (11:17 +0200)]
Merge branch 'stable-5.2' into stable-5.3

* stable-5.2:
  [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache
  Bazel: Format BUILD files with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Fix warning about deprecated lib.bzl
  Format lib/BUILD with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Bump minimum supported version to 0.29.0
  Bazel: Bump skylib library version to 0.8.0
  Use bazelisk to switch between used bazel version
  Bazel: Require minimum bazel version 0.17.1
  Fix wrong placeholder index in error message packInaccessible
  JGitText: Remove unused externalized strings
  RepoText: Remove unused externalized string
  CLI: Remove unused externalized strings

Change-Id: I0d8b7f79177a20dc00c89e2cf0005eb3d3039532
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years ago[error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache 03/149103/5
Matthias Sohn [Sat, 7 Sep 2019 09:38:58 +0000 (11:38 +0200)]
[error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache

We don't need to update time atomically since it's only used to order
cache entries in LRU order.

Change-Id: I756fa6d90b180c519bf52925f134763744f2c1f1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoBazel: Format BUILD files with buildifier 14/149114/1
David Pursehouse [Sun, 8 Sep 2019 01:09:07 +0000 (10:09 +0900)]
Bazel: Format BUILD files with buildifier

Change-Id: I8b4abf67fba592be42b2b5b029fa0e972d746dcb
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Add fixes for --incompatible_load_java_rules_from_bzl 13/149113/1
David Pursehouse [Sun, 8 Sep 2019 01:08:39 +0000 (10:08 +0900)]
Bazel: Add fixes for --incompatible_load_java_rules_from_bzl

Change-Id: Ifc47ae22209fdb7a5d7bede4da002640ed26a43a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoMerge branch 'stable-5.1' into stable-5.2 01/149101/2
Matthias Sohn [Sat, 7 Sep 2019 09:07:21 +0000 (11:07 +0200)]
Merge branch 'stable-5.1' into stable-5.2

* stable-5.1:
  Bazel: Fix warning about deprecated lib.bzl
  Format lib/BUILD with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Bump minimum supported version to 0.29.0
  Bazel: Bump skylib library version to 0.8.0
  Use bazelisk to switch between used bazel version
  Bazel: Require minimum bazel version 0.17.1
  Fix wrong placeholder index in error message packInaccessible
  JGitText: Remove unused externalized strings
  RepoText: Remove unused externalized string
  CLI: Remove unused externalized strings

Change-Id: Iea37a8e39e9d4872dc607c9222dcf191ce4e4757
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoBazel: Fix warning about deprecated lib.bzl 98/149098/3
David Pursehouse [Sat, 7 Sep 2019 06:28:32 +0000 (15:28 +0900)]
Bazel: Fix warning about deprecated lib.bzl

Change-Id: Ifdbaaf9ec020a621070eea351f791a819d554012
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoFormat lib/BUILD with buildifier 85/149085/4
David Pursehouse [Sat, 7 Sep 2019 00:32:19 +0000 (09:32 +0900)]
Format lib/BUILD with buildifier

Change-Id: I4f0ad64371b160b67797f49b9fde521e5dea9396
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Add fixes for --incompatible_load_java_rules_from_bzl 33/148933/7
David Pursehouse [Thu, 5 Sep 2019 00:46:59 +0000 (09:46 +0900)]
Bazel: Add fixes for --incompatible_load_java_rules_from_bzl

Change-Id: I24746335db132bf20f400cb3db400737596d4542
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoBazel: Bump minimum supported version to 0.29.0 96/148996/5
David Ostrovsky [Thu, 5 Sep 2019 20:07:46 +0000 (22:07 +0200)]
Bazel: Bump minimum supported version to 0.29.0

Change-Id: I069e56deb964624791bb0aa3ae095629adfe3bbb
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
5 years agoBazel: Bump skylib library version to 0.8.0 97/149097/3
David Ostrovsky [Sat, 8 Jun 2019 15:31:33 +0000 (17:31 +0200)]
Bazel: Bump skylib library version to 0.8.0

Change-Id: I2089899c9f197b2c93b93390fdd55f6fe11e5ce4
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
5 years agoUse bazelisk to switch between used bazel version 99/149099/2
David Ostrovsky [Sat, 8 Jun 2019 15:33:28 +0000 (17:33 +0200)]
Use bazelisk to switch between used bazel version

Bazelisk is utility to switch to the right Bazel version, that we
used to have with Buck build tool: [1].

Bazelisk will download the right Bazel version only once and will use
it in subsequent calls:

  $ bazelisk build :release
  2019/06/06 16:22:15 Downloading \
  https://releases.bazel.build/0.26.1/release/bazel-0.26.1-linux-x86_64...

Bazelisk is storing the binaries in user's cache directory: [2], e.g.
on Linux OS:

  $ ls -1 ~/.cache/bazelisk/bin
  bazel-0.26.1-linux-x86_64

* [1] https://github.com/bazelbuild/bazelisk
* [2] https://golang.org/pkg/os/#UserCacheDir

Change-Id: Ia9180fb75f8cc17a0a0232622cf33a13bfad6b60
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
5 years agoBazel: Require minimum bazel version 0.17.1 96/149096/3
David Pursehouse [Wed, 10 Oct 2018 01:53:35 +0000 (10:53 +0900)]
Bazel: Require minimum bazel version 0.17.1

Check the bazel version using the checker from bazel_skylib, and
require at least version 0.17.1 which is the minimum version that
does not suffer from the Java API mismatch issue [1].

The implementation is borrowed from the Gerrit project.

[1] https://github.com/bazelbuild/bazel/issues/6027

Change-Id: I224250088a1f5072fcaa3ec81228f4d2cb8cb389
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoFix wrong placeholder index in error message packInaccessible 05/149005/4
Matthias Sohn [Thu, 5 Sep 2019 22:52:48 +0000 (00:52 +0200)]
Fix wrong placeholder index in error message packInaccessible

See: https://www.eclipse.org/lists/jgit-dev/msg03850.html
Change-Id: I0e121a2b7ac399f4a663fa49ab330d27363e9a55
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGitText: Remove unused externalized strings 09/149009/3
David Pursehouse [Fri, 6 Sep 2019 02:06:33 +0000 (11:06 +0900)]
JGitText: Remove unused externalized strings

Change-Id: I995d7a1b6ab2866221eee9f5cb828b97192daf4a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoRepoText: Remove unused externalized string 07/149007/3
David Pursehouse [Fri, 6 Sep 2019 01:04:42 +0000 (10:04 +0900)]
RepoText: Remove unused externalized string

Change-Id: Ida47637f54afdb76513be9b04aae32107567d4e3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoCLI: Remove unused externalized strings 06/149006/3
David Pursehouse [Fri, 6 Sep 2019 00:20:55 +0000 (09:20 +0900)]
CLI: Remove unused externalized strings

Change-Id: Id44117dd72b0e71e9bf0046a3c965eeae64cf3ea
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
5 years agoReceivePack: Prevent pointing a branch to a non-commit object 51/147751/17
Yunjie Li [Thu, 15 Aug 2019 17:39:25 +0000 (10:39 -0700)]
ReceivePack: Prevent pointing a branch to a non-commit object

Since commit c3b0dec509fe136c5417422f31898b5a4e2d5e02, Git has
disallowed writing a non-commit to refs/heads/* refs.  JGit still
allows that, which can put users in a bad situation.  For example,

git push origin v1.0:master

pushes the tag object v1.0 to refs/heads/master, instead of the
intended commit object v1.0^{commit}.

Prevent that by validating that the target of the ref points to a
commit object when pushing to refs/heads/*.

Git performs the same check at a lower level (in the RefDatabase).  We
could do the same here, but for now let's start conservatively by
handling it in pushes first.

[jn: fleshed out commit message]

Change-Id: I8f98ae6d8acbcd5ef7553ec732bc096cb6eb7c4e
Signed-off-by: Yunjie Li <yunjieli@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
5 years agoMerge branch 'stable-5.5' 54/148954/1
Matthias Sohn [Thu, 5 Sep 2019 08:32:35 +0000 (10:32 +0200)]
Merge branch 'stable-5.5'

* stable-5.5:
  Update Orbit to R20190827152740 for 2019-09
  Prepare 5.5.0-SNAPSHOT builds
  JGit v5.5.0.201909041048-rc1

Change-Id: I008b374824e95138c78b4cdd56d39c47800d8cec
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoUpdate Orbit to R20190827152740 for 2019-09 48/148948/1
Matthias Sohn [Thu, 5 Sep 2019 08:27:51 +0000 (10:27 +0200)]
Update Orbit to R20190827152740 for 2019-09

Change-Id: I31d0ba525990cd391b704431212d98ce8b8b3970
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.5.0-SNAPSHOT builds 09/148909/1
Matthias Sohn [Wed, 4 Sep 2019 16:00:19 +0000 (18:00 +0200)]
Prepare 5.5.0-SNAPSHOT builds

Change-Id: I96bbefd698c74e450d05d21572d4769c6c5aaea6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.5.0.201909041048-rc1 00/148900/1 v5.5.0.201909041048-rc1
Matthias Sohn [Wed, 4 Sep 2019 14:47:57 +0000 (16:47 +0200)]
JGit v5.5.0.201909041048-rc1

Change-Id: I77a8c73cfd0a27b1242eddf32da513ce0148260e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.5' 61/148861/1
Matthias Sohn [Wed, 4 Sep 2019 00:42:51 +0000 (02:42 +0200)]
Merge branch 'stable-5.5'

* stable-5.5:
  Prepare 5.4.4-SNAPSHOT builds
  JGit v5.4.3.201909031940-r
  Prepare 5.3.6-SNAPSHOT builds
  JGit v5.3.5.201909031855-r
  Prepare 5.1.12-SNAPSHOT builds
  JGit v5.1.11.201909031202-r
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings
  sshd: fix proxy connections with the DefaultProxyDataFactory
  sshd: support the HashKnownHosts configuration
  sshd: configurable server key verification
  sshd: allow setting a null ssh config
  sshd: simplify OpenSshServerKeyVerifier
  sshd: simplify ServerKeyLookup interface
  Use https in update site URLs

Change-Id: Icd21a8fcccffd56bfedbd037e48028308db6d13b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoMerge branch 'stable-5.4' into stable-5.5 60/148860/1
Matthias Sohn [Wed, 4 Sep 2019 00:20:44 +0000 (02:20 +0200)]
Merge branch 'stable-5.4' into stable-5.5

* stable-5.4:
  Prepare 5.4.4-SNAPSHOT builds
  JGit v5.4.3.201909031940-r
  Prepare 5.3.6-SNAPSHOT builds
  JGit v5.3.5.201909031855-r
  Prepare 5.1.12-SNAPSHOT builds
  JGit v5.1.11.201909031202-r
  Prepare 4.11.10-SNAPSHOT builds
  JGit v4.11.9.201909030838-r
  Bazel: Update bazlets to the latest master revision
  Bazel: Remove FileTreeIteratorWithTimeControl from BUILD file
  BatchRefUpdate: repro racy atomic update, and fix it
  Delete unused FileTreeIteratorWithTimeControl
  Fix RacyGitTests#testRacyGitDetection
  Change RacyGitTests to create a racy git situation in a stable way
  Silence API warnings

Change-Id: Icd6630db6458971f840c3ab4553e00f6c775ede0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoPrepare 5.4.4-SNAPSHOT builds 59/148859/1
Matthias Sohn [Tue, 3 Sep 2019 23:48:25 +0000 (01:48 +0200)]
Prepare 5.4.4-SNAPSHOT builds

Change-Id: I64c03436c285bd8eb5e87abe560417402b60e695
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
5 years agoJGit v5.4.3.201909031940-r 58/148858/1 v5.4.3.201909031940-r
Matthias Sohn [Tue, 3 Sep 2019 23:40:09 +0000 (01:40 +0200)]
JGit v5.4.3.201909031940-r

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