]> source.dussan.org Git - jgit.git/log
jgit.git
6 years agoExternalize warning message in RefDirectory.delete() 71/128071/2
Matthias Sohn [Thu, 23 Aug 2018 09:44:28 +0000 (11:44 +0200)]
Externalize warning message in RefDirectory.delete()

Change-Id: Icec16c01853a3f5ea016d454b3d48624498efcce
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoHttpClientConnectionTest: Throw UnsupportedOperationException for unused methods 73/127973/5
David Pursehouse [Fri, 24 Aug 2018 02:38:25 +0000 (11:38 +0900)]
HttpClientConnectionTest: Throw UnsupportedOperationException for unused methods

The HttpResponseMock class is only used in a single test to assert
on the expected headers. All of its overridden methods are empty, and
this results in warnings in Eclipse:

  'Empty block should be documented'

Rather than adding "// Not used" comments, change all of the methods'
implementations to throw UnsupportedOperationException. This not only
gets rid of the warnings, but also makes it explicit that we don't
intend any of them to actually be called.

Change-Id: I8fe06b155e0809bb3507e4e28b00fcc4f9333b0b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoHttpClientConnectionTest: Reformat with the Eclipse style 98/128098/2
David Pursehouse [Sun, 26 Aug 2018 23:43:27 +0000 (08:43 +0900)]
HttpClientConnectionTest: Reformat with the Eclipse style

Change-Id: I1066dea0bbb4573aabaf417365fb46772f0f4d0e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoHttpClientConnectionTest: Add missing license header 96/128096/1
David Pursehouse [Sun, 26 Aug 2018 23:40:24 +0000 (08:40 +0900)]
HttpClientConnectionTest: Add missing license header

Change-Id: I9e4bd2bfe16f4824eb8ed7ccfab332646b3233b1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-5.0' 32/128032/6
Matthias Sohn [Sat, 25 Aug 2018 14:07:20 +0000 (16:07 +0200)]
Merge branch 'stable-5.0'

* stable-5.0:
  Silence API warning for new ObjectIdSerializer introduced in 4.11.1
  Ignore API warnings
  Fix photon target platform to use photon version of org.eclipse.osgi
  Update Photon orbit repository to R20180606145124
  Suppress warning for trying to delete non-empty directory
  Fix fetching with duplicate ref updates
  Fetch(Process): should tolerate duplicate refspecs
  FetchCommandTest: test add/update/delete fetch

Change-Id: I9e7fa37b100a7ea3cbe4104802d36c6f38df9e08
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 70/127970/3
Matthias Sohn [Sat, 25 Aug 2018 06:56:45 +0000 (08:56 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Silence API warning for new ObjectIdSerializer introduced in 4.11.1
  Ignore API warnings
  Fix photon target platform to use photon version of org.eclipse.osgi
  Update Photon orbit repository to R20180606145124
  Suppress warning for trying to delete non-empty directory
  Fix fetching with duplicate ref updates
  Fetch(Process): should tolerate duplicate refspecs
  FetchCommandTest: test add/update/delete fetch

Change-Id: I2497f99b7d0686a0e0f773c39c8725e813ce9d4a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoSilence API warning for new ObjectIdSerializer introduced in 4.11.1 46/128046/2
Matthias Sohn [Fri, 24 Aug 2018 16:33:50 +0000 (18:33 +0200)]
Silence API warning for new ObjectIdSerializer introduced in 4.11.1

Change-Id: Ic271dae300f7554b7e13bb1f44006e5b38c00011
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 47/127947/4
Matthias Sohn [Fri, 24 Aug 2018 16:25:28 +0000 (18:25 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Ignore API warnings
  Fix photon target platform to use photon version of org.eclipse.osgi
  Update Photon orbit repository to R20180606145124
  Suppress warning for trying to delete non-empty directory
  Fix fetching with duplicate ref updates
  Fetch(Process): should tolerate duplicate refspecs
  FetchCommandTest: test add/update/delete fetch

Change-Id: I47671108574fcd10fe016a58e38c038af54a6748
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agopgm: remove explicit version of log4j and slf4j in pom.xml 75/127975/2
David Pursehouse [Fri, 24 Aug 2018 03:10:18 +0000 (12:10 +0900)]
pgm: remove explicit version of log4j and slf4j in pom.xml

The version is inherited from the master pom.xml so does not need
to be explicitly specified, unless the intent is to override the
version. This is not the case, though, since the versions are
specified with the properties defined in the master pom.xml.

Despite the fact that using the properties results in the versions
effectively not being overridden, Eclipse still warns about it,
seemingly due the fact that a value is given in the version field.

Change-Id: I163ede6689b9e2e7dd7b21f22b4068d638fa97aa
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoDon't override managed version of httpclient for LFS server tests 74/127974/2
David Pursehouse [Fri, 24 Aug 2018 03:05:31 +0000 (12:05 +0900)]
Don't override managed version of httpclient for LFS server tests

The version is 4.5.5 in the master pom.xml but overridden with 4.3.6
in the LFS server tests pom.xml.

Remove the override so that the same version is used everywhere.

Change-Id: Ibccc93a0c2a9c05db23cf131585184d67611b579
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoHttpClientTests: Open OutputStream in try-with-resource 72/127972/2
David Pursehouse [Fri, 24 Aug 2018 02:20:59 +0000 (11:20 +0900)]
HttpClientTests: Open OutputStream in try-with-resource

Change-Id: Ib690b0af6d562765f43ad54d3855200a17eaa90b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoHttpClientTests: Use assertEquals to assert about response code 71/127971/2
David Pursehouse [Fri, 24 Aug 2018 02:18:47 +0000 (11:18 +0900)]
HttpClientTests: Use assertEquals to assert about response code

The current usage of assertThat causes a warning in Eclipse:

  "The expression of type int is boxed into Integer".

Replace it with assertEquals which does not cause this warning, and is
consistent with how such assertions are done in other tests.

Change-Id: Id3de3548353bf6be069b6ede89c605d094b6d3f4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoAdd fetch support to ProtocolV2Hook 55/127955/8
Ivan Frade [Wed, 22 Aug 2018 21:45:37 +0000 (14:45 -0700)]
Add fetch support to ProtocolV2Hook

This makes it symmetrical with ls-refs operation and gives the
instantiator of UploadPack the chance to run some code after parsing
the protocol and before any actual work for the fetch starts.

Request and Builder methods keep the naming in the original code to
make this change just about request encapsulation and hook invocation.
They are package-private for now to allow further improvements.

Change-Id: I5ad585c914d3a5f23b11c8251803faa224beffb4
Signed-off-by: Ivan Frade <ifrade@google.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 30/127930/3
Matthias Sohn [Fri, 24 Aug 2018 15:39:07 +0000 (17:39 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Ignore API warnings
  Fix photon target platform to use photon version of org.eclipse.osgi
  Update Photon orbit repository to R20180606145124
  Suppress warning for trying to delete non-empty directory
  Fix fetching with duplicate ref updates
  Fetch(Process): should tolerate duplicate refspecs
  FetchCommandTest: test add/update/delete fetch

Change-Id: I2a83c059b7014c2a9e6267c963422c7785b23f17
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoIgnore API warnings 40/128040/1
Matthias Sohn [Fri, 24 Aug 2018 15:23:00 +0000 (17:23 +0200)]
Ignore API warnings

The following commits introduced in stable-4.5 and stable-4.9
introduced some minor API additions in service releases.

f7ceeaa2 FileRepository: Add pack-based inserter implementation
085d1f95 Make PackInserter public
10e65cb4 Fix LockFile semantics when running on NFS

Change-Id: I4afed7e0395cf93d828e671080e3ec9ddf20987d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix photon target platform to use photon version of org.eclipse.osgi 35/128035/1
Matthias Sohn [Thu, 23 Aug 2018 10:59:15 +0000 (12:59 +0200)]
Fix photon target platform to use photon version of org.eclipse.osgi

Change-Id: I81cb499a5092eed6569f6fdf612ecab3f5d9bd5e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUploadPack: shallowExcludeRefs doesn't need to be nullable 63/127963/2
Ivan Frade [Thu, 23 Aug 2018 22:20:57 +0000 (15:20 -0700)]
UploadPack: shallowExcludeRefs doesn't need to be nullable

Code can check size instead of null, and that makes the initialization
trivial.

Change-Id: Icbe655816429a7a680926b0e871d96f3b2f1f7ba
Signed-off-by: Ivan Frade <ifrade@google.com>
6 years agoUpdate Photon orbit repository to R20180606145124 15/127915/1
Matthias Sohn [Thu, 23 Aug 2018 09:29:15 +0000 (11:29 +0200)]
Update Photon orbit repository to R20180606145124

The S-repository doesn't exist anymore and we should have updated to the
final Photon orbit repository already.

Change-Id: I6d1757833be4abd3643677d6e7814363533e88b2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRefDirectory: Add missing $NON-NLS suppression 97/127897/1
David Pursehouse [Thu, 23 Aug 2018 07:51:19 +0000 (16:51 +0900)]
RefDirectory: Add missing $NON-NLS suppression

Change-Id: I6afb4f86c3a8a06e5ea3128bf1b9b20c46ca158c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agorefactor: simplify collection.toArray() 94/127094/3
Michael Keppler [Mon, 6 Aug 2018 12:11:26 +0000 (14:11 +0200)]
refactor: simplify collection.toArray()

On recent VMs, collection.toArray(new T[0]) is faster than
collection.toArray(new T[collection.size()]). Since it is also more
readable, it should now be the preferred way of collection to array
conversion.

https://shipilev.net/blog/2016/arrays-wisdom-ancients/

Change-Id: I80388532fb4b2b0663ee1fe8baa94f5df55c8442
Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
6 years agoUploadPack: Add missing $NON-NLS suppressions 90/127890/1
David Pursehouse [Thu, 23 Aug 2018 02:34:58 +0000 (11:34 +0900)]
UploadPack: Add missing $NON-NLS suppressions

Change-Id: Ica2cc0ed23a7667bcb8d2006fd0a6ba6bddfee9a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUploadPack: Remove redundant specification of type 89/127889/1
David Pursehouse [Thu, 23 Aug 2018 02:33:17 +0000 (11:33 +0900)]
UploadPack: Remove redundant specification of type

Change-Id: I257635ed3f9ce012e03a3c45ed666fb9195019e0
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUpgrade spotbugs to 3.1.6 88/127888/1
David Pursehouse [Thu, 23 Aug 2018 02:29:11 +0000 (11:29 +0900)]
Upgrade spotbugs to 3.1.6

Change-Id: Id84497107ef9ee2eca3c9d65197ab8c14f492655
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSuppress warning for trying to delete non-empty directory 71/127671/4
Thomas Wolf [Sun, 19 Aug 2018 18:48:06 +0000 (20:48 +0200)]
Suppress warning for trying to delete non-empty directory

This is actually a fairly common occurrence; deleting the parent
directories can work only if the file deleted was the last one
in the directory.

Bug: 537872
Change-Id: I86d1d45e1e2631332025ff24af8dfd46c9725711
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoFix fetching with duplicate ref updates 70/127670/3
Thomas Wolf [Sun, 19 Aug 2018 18:43:50 +0000 (20:43 +0200)]
Fix fetching with duplicate ref updates

If packed refs are used, duplicate updates result in an exception
because JGit tries to lock the same lock file twice. With non-atomic
ref updates, this used to work, since the same ref would simply be
locked and updated twice in succession.

Let's be more lenient in this case and remove duplicates before
trying to do the ref updates. Silently skip duplicate updates
for the same ref, if they both would update the ref to the same
object ID. (If they don't, behavior is undefined anyway, and we
still throw an exception.)

Add a test that results in a duplicate ref update for a tag.

Bug: 529400
Change-Id: Ide97f20b219646ac24c22e28de0c194a29cb62a5
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoFetch(Process): should tolerate duplicate refspecs 69/127669/3
Marc Strapetz [Sat, 30 Dec 2017 10:33:41 +0000 (11:33 +0100)]
Fetch(Process): should tolerate duplicate refspecs

Bug: 529314
Change-Id: I91eaeda8a988d4786908fba6de00478cfc47a2a2
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoFetchCommandTest: test add/update/delete fetch 68/127668/3
Marc Strapetz [Sat, 30 Dec 2017 10:12:14 +0000 (11:12 +0100)]
FetchCommandTest: test add/update/delete fetch

Change-Id: I2442394fb7eae5b3715779555477dd27b274ee83
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoAdd SuppressWarnings for FutureReturnValueIgnored 01/127801/3
Masaya Suzuki [Tue, 21 Aug 2018 17:00:59 +0000 (10:00 -0700)]
Add SuppressWarnings for FutureReturnValueIgnored

https://errorprone.info/bugpattern/FutureReturnValueIgnored

The submitted task logs the error in case it fails.

Change-Id: I280442ddb8046da47aeb79d005886f65d2e3067b
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
6 years agoMerge "Support remove-project node in the manifest parser"
Jonathan Nieder [Tue, 21 Aug 2018 02:14:35 +0000 (22:14 -0400)]
Merge "Support remove-project node in the manifest parser"

6 years agoSupport remove-project node in the manifest parser 77/126577/4
Masaya Suzuki [Tue, 24 Jul 2018 19:22:11 +0000 (12:22 -0700)]
Support remove-project node in the manifest parser

This directive removes the projects added by other directives.

https://gerrit.googlesource.com/git-repo/+/65b0ba5aa0447f7ee25103828115662b1eb80ff9/manifest_xml.py#614
https://gerrit.googlesource.com/git-repo/+/e469a0c741832f6584513f4a382d6b93f417b8d2/docs/manifest-format.txt#339

Change-Id: I90d7b9fc711b586dec05f475422d34d67d909986
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
6 years agoRemove unnecessary maven dependency of org.eclipse.jgit to httpclient 63/127663/2
Matthias Sohn [Sun, 19 Aug 2018 13:34:47 +0000 (15:34 +0200)]
Remove unnecessary maven dependency of org.eclipse.jgit to httpclient

Change-Id: Icc3c696a46adaf0e7b633913a3f36f0440a81e3a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUpdate bazel dependencies to match maven dependencies 49/127649/3
Matthias Sohn [Sat, 18 Aug 2018 23:43:30 +0000 (01:43 +0200)]
Update bazel dependencies to match maven dependencies

Update
- jsch to 0.1.54
- httpclient to 4.5.5
- httpcore to 4.4.9
- commons-codec to 1.10
- commons-logging to 1.2
- junit to 4.12

Change-Id: I84eeb8dd786e68dd03079ae2c2aef5d7286dfb56
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoSubmoduleDeinitTest fails on Windows 67/127667/1
Andrey Loskutov [Sun, 19 Aug 2018 18:53:31 +0000 (20:53 +0200)]
SubmoduleDeinitTest fails on Windows

Bug: 538068
Change-Id: I982e8b12936582e8e119f45d7a3bf4888d3e0e1a
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
6 years agoFilterCommandsTest fails on Windows 66/127666/1
Andrey Loskutov [Sun, 19 Aug 2018 18:32:00 +0000 (20:32 +0200)]
FilterCommandsTest fails on Windows

Bug: 538068
Change-Id: I3ba6fceef2c34cacc0c37150206379aa93b5e3d0
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
6 years agoReceivePackAdvertiseRefsHookTest.testSuccess() fails on Windows 65/127665/1
Andrey Loskutov [Sun, 19 Aug 2018 16:08:50 +0000 (18:08 +0200)]
ReceivePackAdvertiseRefsHookTest.testSuccess() fails on Windows

The TransportLocal object created in
newTransportLocalWithStrictValidation() closes original repository and
increments use of test internal "dst" repository, but never decrements
use. Because of this, pack file is not closed and during tearDown on
Windows system is unable to delete it.

Bug: 538068
Change-Id: I96df8e91abfee78c91cf26c2466718e9145a69db
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
6 years agoUpdate Jetty to 9.4.11.v20180605 48/127648/1
Matthias Sohn [Sat, 18 Aug 2018 17:16:58 +0000 (19:16 +0200)]
Update Jetty to 9.4.11.v20180605

Change-Id: I1d2ad0536a0fd02361e17d0175eaeca2c047660c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-5.0' 36/127636/2
Matthias Sohn [Sat, 18 Aug 2018 11:57:42 +0000 (13:57 +0200)]
Merge branch 'stable-5.0'

* stable-5.0:
  Fix GC run in foreground to not use executor

Change-Id: I484391e5589d70de136126d153f886f5afa12e88
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 33/127633/2
Matthias Sohn [Sat, 18 Aug 2018 11:55:24 +0000 (13:55 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Fix GC run in foreground to not use executor

Change-Id: I9bb1506805a2d5e79a420a1152bc45321c081229
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 32/127632/2
Matthias Sohn [Sat, 18 Aug 2018 11:51:45 +0000 (13:51 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Fix GC run in foreground to not use executor

Change-Id: I565b95de6c89f021475667caaacdbb08caddd881
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 31/127631/2
Matthias Sohn [Sat, 18 Aug 2018 11:51:00 +0000 (13:51 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Fix GC run in foreground to not use executor

Change-Id: Ib4d76125fca7eec9e88666688b5e614e7e20dde7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 30/127630/2
Matthias Sohn [Sat, 18 Aug 2018 11:47:51 +0000 (13:47 +0200)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Fix GC run in foreground to not use executor

Change-Id: Id9d864a8e727fefa35ca87eccb4e3801eb689c3c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 26/127626/2
Matthias Sohn [Sat, 18 Aug 2018 11:40:33 +0000 (13:40 +0200)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Fix GC run in foreground to not use executor

Change-Id: Ib150d132e2ce055d36ddffb2dbc37b5cb355e77a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUpdate org.apache.commons.codec and org.apache.commons.logging 35/127635/1
Matthias Sohn [Sat, 18 Aug 2018 09:29:35 +0000 (11:29 +0200)]
Update org.apache.commons.codec and org.apache.commons.logging

Update
- org.apache.commons.codec to 1.10.0.v20180409-1845
- org.apache.commons.logging to 1.2.0.v20180409-1502

According to [1] this is required for the update of httpcore and
httpclient we did in 63a3e415.

[1] https://dev.eclipse.org/mhonarc/lists/cross-project-issues-dev/msg15823.html

CQ: 16962
CQ: 16963
Change-Id: I1d40ffc90d17fe2c29ad704013535f20af4b231b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-5.0' 48/127548/1
Matthias Sohn [Thu, 16 Aug 2018 23:24:10 +0000 (01:24 +0200)]
Merge branch 'stable-5.0'

* stable-5.0:
  Fix wrong warning message in case of lock failures

Change-Id: Ia9b813652a2f5b6c78e9587367c35c3a6c177a7a

6 years agoUpdate apache httpcore and httpclient 46/127546/2
Matthias Sohn [Thu, 16 Aug 2018 22:20:04 +0000 (00:20 +0200)]
Update apache httpcore and httpclient

Update
- org.apache.httpcomponents.httpclient to 4.5.5.v20180409-1525
- org.apache.httpcomponents.httpcore to 4.4.9.v20180409-1525

CQ: 16959
CQ: 16960
Change-Id: I11f2979e1c39fe26421693a7c694e51c471326a0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix wrong warning message in case of lock failures 38/127538/1
Christian Halstrick [Thu, 16 Aug 2018 15:44:28 +0000 (17:44 +0200)]
Fix wrong warning message in case of lock failures

Bug: 537969
Change-Id: I0854bbbe7393abaca36640d429886c30d95d5bf1

6 years agoIntroduce ProtocolV2Hook 77/122977/9
Masaya Suzuki [Fri, 18 May 2018 17:06:56 +0000 (10:06 -0700)]
Introduce ProtocolV2Hook

In Git protocol v2, UploadPack and ReceivePack have the same
capabilities and can process any protocol v2 request. For example, a
client can sent a "fetch" command to the "/git-receive-pack" endpoint.

This makes it difficult for existing hook interfaces. For example,
PreUploadHook takes UploadPack, but a "fetch" command may be received by
ReceivePack.

To resolve this skew, this change introduce a different hook interface
for the protocol v2. The hook takes a request that is independent to the
handlers (UploadPack, ReceivePack). Also this makes it clear what
parameters the hook is counting on, instead of keep track of the hook
using getters from UploadPack / ReceivePack.

Bug: 534847
Change-Id: I71f3266584483db1e2b2edfc1a72d0bdf1bb6041
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
6 years agoFix GC run in foreground to not use executor 47/127447/3
Hugo Arès [Wed, 15 Aug 2018 13:54:29 +0000 (09:54 -0400)]
Fix GC run in foreground to not use executor

Since I3870cadb4, GC task was always delegated to an executor even when
background option was set to false. This was an issue because if more
than one GC object was instantiated and executed in parallel, only one GC
was actually running because of the single thread executor.

Change-Id: I8c587d22d63c1601b7d75914692644a385cd86d6
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
6 years agoAdd EMPTY_TREE_ID as a sibling of EMPTY_BLOB_ID 73/127473/2
Dave Borowitz [Wed, 15 Aug 2018 22:42:58 +0000 (15:42 -0700)]
Add EMPTY_TREE_ID as a sibling of EMPTY_BLOB_ID

Change-Id: Id68b3e1db7294cf9adb8b4ce8eecb1d828687eef

6 years agoUpdate javadoc for EMPTY_BLOB_ID 72/127472/2
Dave Borowitz [Wed, 15 Aug 2018 22:42:19 +0000 (15:42 -0700)]
Update javadoc for EMPTY_BLOB_ID

Found original version with:

  $ git describe --contains $(git blame fc4d4b5340911989e444b150ae6a859f486feba9 org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java | grep EMPTY_BLOB_ID | cut -d' ' -f1)
  v0.9.1~164

Change-Id: I1f86bde42615c8b64064894bde44f82660b38d0f

6 years agoMerge "Declare ConfigConstants and GitProtocolConstants final"
Jonathan Nieder [Tue, 14 Aug 2018 22:55:26 +0000 (18:55 -0400)]
Merge "Declare ConfigConstants and GitProtocolConstants final"

6 years agoDeclare ConfigConstants and GitProtocolConstants final 34/127434/2
Matthias Sohn [Tue, 14 Aug 2018 22:31:37 +0000 (00:31 +0200)]
Declare ConfigConstants and GitProtocolConstants final

This avoids that we have to suppress API errors whenever we add a new
constant in a minor release. This change affects implementors only which
is ok to do in a minor release following OSGi semantic versioning rules.

Change-Id: Iece841886fbe00f1ba567c5ff68093c542ba265e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRespond with shallow-info before wanted-refs 68/127368/1
Jonathan Tan [Mon, 13 Aug 2018 23:57:25 +0000 (16:57 -0700)]
Respond with shallow-info before wanted-refs

When fetching with protocol v2, git expects the shallow-info section to
appear before wanted-refs if both appear in the response. Teach
UploadPack to do this.

Change-Id: Ie26a91edcce5d27a1d727d7fba5c30e1144e118b
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
6 years agoUse a TreeMap to construct the list of renamed projects 50/127250/4
Han-Wen Nienhuys [Thu, 9 Aug 2018 14:30:09 +0000 (16:30 +0200)]
Use a TreeMap to construct the list of renamed projects

This eliminates one source of unpredictable ordering of entries in .gitmodules.

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

6 years agoMerge "Fix ResolveMerger: rebase with autocrlf=true, direct checkout"
Gunnar Wagenknecht [Mon, 13 Aug 2018 11:36:44 +0000 (07:36 -0400)]
Merge "Fix ResolveMerger: rebase with autocrlf=true, direct checkout"

6 years agoFix ResolveMerger: rebase with autocrlf=true, direct checkout 90/127290/3
Thomas Wolf [Fri, 10 Aug 2018 09:11:50 +0000 (11:11 +0200)]
Fix ResolveMerger: rebase with autocrlf=true, direct checkout

ResolveMerger.checkout() and cleanUp() check out files directly and
must honor CR/LF settings and also smudge filters.

Deprecate the 3-argument version of DirCacheCheckout.checkoutEntry().
It isn't used anymore anywhere in JGit (nor in EGit).

Bug: 537410
Change-Id: I062b35401c8bd5bc99deb2f68f91089a0643504c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoSupport protocol v2 want-ref in UploadPack 64/126564/4
Jonathan Tan [Tue, 24 Jul 2018 15:41:17 +0000 (08:41 -0700)]
Support protocol v2 want-ref in UploadPack

UploadPack already allows the client to send wanted OIDs as "want"
lines. Extend UploadPack to also allow the client to send wanted ref
names as "want-ref" lines when the fetch is done using protocol v2.

The corresponding Git commit is 516e2b76bd ("upload-pack: implement
ref-in-want", 2018-06-28).

To support a two-stage rollout, two configuration variables are
provided: uploadpack.allowrefinwant (default "false") allows clients to
specify "want-ref" in their requests, and uploadpack.advertiserefinwant
(default "true") makes UploadPack advertise this capability. If
uploadpack.allowrefinwant is true but uploadpack.advertiserefinwant is
false, UploadPack will not advertise that it supports "want-ref", but it
will support it.

Change-Id: I3c24077949640d453af90d81a7f48ce4b8ac9833
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
6 years agoMerge remote-tracking branch 'origin/stable-5.0' 27/127227/1
Thomas Wolf [Thu, 9 Aug 2018 10:03:45 +0000 (12:03 +0200)]
Merge remote-tracking branch 'origin/stable-5.0'

* stable-5.0:
  Ensure that JSch knows HostKeyAlgorithms ssh-rsa and ssh-dss

Change-Id: I76899a1f6b3d9348d138266e05e1320b7429bfd1
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoEnsure that JSch knows HostKeyAlgorithms ssh-rsa and ssh-dss 87/127187/1
Thomas Wolf [Wed, 8 Aug 2018 11:36:35 +0000 (13:36 +0200)]
Ensure that JSch knows HostKeyAlgorithms ssh-rsa and ssh-dss

Without these registrations, JSch's up-front checks which algorithms
are available at all fail if the ssh config explicitly sets only these
algorithms.

Bug: 537790
Change-Id: Idb0431190a7f101913363ee95af6c8fcbda6c923
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoFix API breakage introduced by da254106 72/127172/5
Matthias Sohn [Tue, 7 Aug 2018 19:33:24 +0000 (21:33 +0200)]
Fix API breakage introduced by da254106

Use org.eclipse.jgit.errors.CancelledException which is a subclass of
IOException instead of org.eclipse.jgit.api.errors.CanceledException in
order to avoid breaking API. We can reconsider this with the next major
version 6.0.

Bug: 536324
Change-Id: Ia6f84f59aa6b7d78b8fccaba24ade320a54f7458
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoAbort rename detection in a timely manner if cancelled 42/126742/7
Matthias Sohn [Sat, 21 Jul 2018 19:50:30 +0000 (21:50 +0200)]
Abort rename detection in a timely manner if cancelled

If progress monitor is cancelled break loops in rename detection by
throwing a CanceledException.

Bug: 536324
Change-Id: Ia3511fb749d2a5d45005e72c156b874ab7a0da26
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoRebaseCommand: Remove unnecessary fall through comments 67/127067/1
Jonathan Nieder [Sat, 4 Aug 2018 21:00:26 +0000 (14:00 -0700)]
RebaseCommand: Remove unnecessary fall through comments

It's easier to read a list of cases

case A:
case B:
case C:
... do something ...;
break;

without intervening "// fall through" lines separating the cases.

This also makes it clearer that JGit uses "$FALL-THROUGH$", not "fall
through", to suppress fallthrough warnings in switch statements.
Eclipse does not pay attention to the second comment style.

Change-Id: I5279a727aee2868854d06bfcaac8cb8186b4299e
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge branch 'stable-5.0' 63/126863/1
Matthias Sohn [Wed, 1 Aug 2018 00:02:05 +0000 (02:02 +0200)]
Merge branch 'stable-5.0'

* stable-5.0:
  Prepare 5.0.3-SNAPSHOT builds
  JGit v5.0.2.201807311906-r
  Prepare 4.11.2-SNAPSHOT builds
  JGit v4.11.1.201807311124-r
  Prepare 4.9.4-SNAPSHOT builds
  JGit v4.9.3.201807311005-r

Change-Id: Ic8a748dbd02187fd783478b702c5795d88e7fe20
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 5.0.3-SNAPSHOT builds 62/126862/1
Matthias Sohn [Tue, 31 Jul 2018 23:30:05 +0000 (01:30 +0200)]
Prepare 5.0.3-SNAPSHOT builds

Change-Id: Iae9d763a65481b09af6e19b33e41375f27038357
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v5.0.2.201807311906-r 60/126860/1 v5.0.2.201807311906-r
Matthias Sohn [Tue, 31 Jul 2018 23:06:30 +0000 (01:06 +0200)]
JGit v5.0.2.201807311906-r

Change-Id: Iccb98c03a069fee85a52325e1ed22cba8b76bcd8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 59/126859/1
Matthias Sohn [Tue, 31 Jul 2018 22:57:07 +0000 (00:57 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.11.2-SNAPSHOT builds
  JGit v4.11.1.201807311124-r
  Prepare 4.9.4-SNAPSHOT builds
  JGit v4.9.3.201807311005-r

Change-Id: I8c8ecc818205e1f5d94c02b463792ea1d72d8ba1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.11.2-SNAPSHOT builds 56/126856/1
Matthias Sohn [Tue, 31 Jul 2018 20:07:17 +0000 (22:07 +0200)]
Prepare 4.11.2-SNAPSHOT builds

Change-Id: I02630900ab131478b30abe68b2133d2c8a5a67ab
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.11.1.201807311124-r 52/126852/1 v4.11.1.201807311124-r
Matthias Sohn [Tue, 31 Jul 2018 15:31:30 +0000 (17:31 +0200)]
JGit v4.11.1.201807311124-r

Change-Id: Ic58a916d7e2c380b84690afa5e3517c6c178af8c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 51/126851/1
Matthias Sohn [Tue, 31 Jul 2018 15:21:10 +0000 (17:21 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Prepare 4.9.4-SNAPSHOT builds
  JGit v4.9.3.201807311005-r

Change-Id: I5f73f240951733e8d81d634aa5340a0861936a0c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 40/126840/1
Matthias Sohn [Tue, 31 Jul 2018 15:11:29 +0000 (17:11 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Prepare 4.9.4-SNAPSHOT builds
  JGit v4.9.3.201807311005-r

Change-Id: Ifd4b815b0f66d44afeafa9ae77a2a714942d675d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoPrepare 4.9.4-SNAPSHOT builds 38/126838/1
Matthias Sohn [Tue, 31 Jul 2018 14:57:13 +0000 (16:57 +0200)]
Prepare 4.9.4-SNAPSHOT builds

Change-Id: Ibb2ee9d00d5d049f681e1abbb449656105e553a7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.9.3.201807311005-r 36/126836/1 v4.9.3.201807311005-r
Matthias Sohn [Tue, 31 Jul 2018 14:05:49 +0000 (16:05 +0200)]
JGit v4.9.3.201807311005-r

Change-Id: I3f4f437649736c6a27e78d536344c7b31c8a0f65
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge "Use project names instead of paths for the submodule name"
Jonathan Nieder [Fri, 27 Jul 2018 22:15:14 +0000 (18:15 -0400)]
Merge "Use project names instead of paths for the submodule name"

6 years agoUse project names instead of paths for the submodule name 74/126574/6
Masaya Suzuki [Tue, 24 Jul 2018 18:53:39 +0000 (11:53 -0700)]
Use project names instead of paths for the submodule name

Two submodules at the same path on different branches need not represent
the same repository, and two submodules at different paths can represent
the same one.

The C Git implementation uses the submodule name to internally manage
the submodule repositories under .git/modules. When a submodule
represents different repositories in different branches, it makes a
conflict inside .git/modules.

The current RepoCommand implementation uses submodule paths as the
submodule names. When the manifest file mounts different repositories to
the same path in different branches, this makes a situation described
above. To solve this issue, we can use the project name instead of
the path as the submodule name.

On the other hand, since repo v1.12.8~3^2 (repo: Support multiple
branches for the same project., 2013-10-11), a manifest file can mount
the same project to different paths. If we naively use the project
name as the submodule name, it makes a conflict in .git/modules, too.

This patch uses the project name as the submodule name basically, but
when the same project is mounted to different paths, it uses the project
name and path as the submodule name.

Change-Id: I09dc7d62ba59016fe28852d3139a56ef7ef49b8f
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Reported-by: JP Sugarbroad <jpsugar@google.com>
6 years agoMerge branch 'stable-5.0' 02/126702/1
Matthias Sohn [Fri, 27 Jul 2018 12:16:42 +0000 (14:16 +0200)]
Merge branch 'stable-5.0'

* stable-5.0:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: I9717444c42ea89195dfcde8bb10121b9bb178e87
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 01/126701/1
Matthias Sohn [Fri, 27 Jul 2018 12:06:14 +0000 (14:06 +0200)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: I780d4a1624fbb97a2acdf5321b9c3244b0626444
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 99/126699/1
Matthias Sohn [Fri, 27 Jul 2018 11:38:21 +0000 (13:38 +0200)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: I2b44d862869d4453c57db668fc7c925da591f671
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 93/126693/1
Matthias Sohn [Fri, 27 Jul 2018 09:03:11 +0000 (11:03 +0200)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: Ie7029bc91621af32e7bfd2e0d76a424b991b1995
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 92/126692/1
Matthias Sohn [Fri, 27 Jul 2018 08:51:58 +0000 (10:51 +0200)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: I6ab2b951dd94a9fc1c4f5283847a3e2ec37d0895
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 34/126634/2
David Pursehouse [Fri, 27 Jul 2018 07:22:51 +0000 (08:22 +0100)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Prepare 4.7.3-SNAPSHOT builds
  JGit v4.7.2.201807261330-r
  Delete all loose refs empty directories
  Use java.nio to delete path to get detailed errors
  GC: Remove empty references folders
  Do not ignore path deletion errors

Change-Id: Iadc8275fbaa3d6f7d08a96ab66d49f392f6aab78
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge "ErrorProne: Enable check for misuse of ExpectedException"
David Pursehouse [Fri, 27 Jul 2018 05:53:59 +0000 (01:53 -0400)]
Merge "ErrorProne: Enable check for misuse of ExpectedException"

6 years agoPrepare 4.7.3-SNAPSHOT builds 85/126685/1
Matthias Sohn [Thu, 26 Jul 2018 23:00:35 +0000 (01:00 +0200)]
Prepare 4.7.3-SNAPSHOT builds

Change-Id: I5c437f45d5bc469e3c32bef1180c127d96d24d23
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoJGit v4.7.2.201807261330-r 75/126675/1 v4.7.2.201807261330-r
Matthias Sohn [Thu, 26 Jul 2018 17:28:38 +0000 (19:28 +0200)]
JGit v4.7.2.201807261330-r

Change-Id: I0d8c7ca756e6236e315c91da000fe8103ce83d05
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoDelete all loose refs empty directories 55/125755/4
Luca Milanesio [Sat, 7 Jul 2018 22:35:20 +0000 (23:35 +0100)]
Delete all loose refs empty directories

Remove completely the empty directories under refs/<namespace>
including the first level partition of the changes, when they are
completely empty.

Bug: 536777
Change-Id: I88304d34cc42435919c2d1480258684d993dfdca
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUse java.nio to delete path to get detailed errors 54/125754/4
Luca Milanesio [Sat, 7 Jul 2018 22:09:36 +0000 (23:09 +0100)]
Use java.nio to delete path to get detailed errors

Get the full IOException of the reason why a directory
cannot be removed during GC.

Change-Id: Ia555bce009fa48087a73d677f1ce3b9c0b685b57
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge "Send only 1 flush pkt at the end of v2 fetch"
Jonathan Nieder [Tue, 24 Jul 2018 22:56:42 +0000 (18:56 -0400)]
Merge "Send only 1 flush pkt at the end of v2 fetch"

6 years agoSend only 1 flush pkt at the end of v2 fetch 80/126580/1
Jonathan Tan [Tue, 24 Jul 2018 22:35:16 +0000 (15:35 -0700)]
Send only 1 flush pkt at the end of v2 fetch

When processing a fetch using protocol v2, UploadPack#fetchV2 sends an
extraneous flush pkt when also sending a packfile (#sendPack sending its
own flush pkt). Update that method to only send the flush pkt if the
packfile is not being sent.

Change-Id: I7117a264bccd2d7f3a048645fcb8425a9d78d526
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
6 years agoFix NPE in BlameGenerator.getSourceStart() 18/126518/1
Matthias Sohn [Mon, 23 Jul 2018 21:07:23 +0000 (23:07 +0200)]
Fix NPE in BlameGenerator.getSourceStart()

Bug: 499543
Change-Id: I99f6ebb1c3ceea20e8ca093acbe824c9f0362d45
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoErrorProne: Enable check for misuse of ExpectedException 44/126144/2
David Pursehouse [Tue, 17 Jul 2018 01:43:04 +0000 (10:43 +0900)]
ErrorProne: Enable check for misuse of ExpectedException

Any additional statements after the statement that is expected to
throw will never be executed in a passing test. This can lead to
inappropriately passing tests where later incorrect assertions are
skipped by the thrown exception. See [1] for examples.

There are no cases of this in the code base, but by enabling the
checker with severity ERROR we can ensure that we don't overlook
any future misuse of ExpectedException.

[1] http://errorprone.info/bugpattern/ExpectedExceptionChecker

Change-Id: I266d4f73f6075bfc1e39fa3d8aee7dee96db61b9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoHttpClientConnection.getHeaderFields should support multiple values for same header 97/126297/7
Gabriel Couto [Thu, 19 Jul 2018 05:34:56 +0000 (05:34 +0000)]
HttpClientConnection.getHeaderFields should support multiple values for same header

Bug: 537166
Change-Id: I1ba645968efe01a88f2484f030b7572228ba169c
Signed-off-by: Gabriel Couto <gmcouto@gmail.com>
6 years agoAlways send refs' objects despite "filter" in pack 48/126048/2
Jonathan Tan [Thu, 12 Jul 2018 17:58:28 +0000 (10:58 -0700)]
Always send refs' objects despite "filter" in pack

In a0c9016abd ("upload-pack: send refs' objects despite "filter"",
2018-07-09), Git updated the "filter" option in the fetch-pack
upload-pack protocol to not filter objects explicitly specified in
"want" lines, even if they match the criterion of the filter. Update
JGit to match that behavior.

Change-Id: Ia4d74326edb89e61062e397e05483298c50f9232
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
6 years agoRepoCommand: record remote branch, group, shallow bit by default 59/126359/1
Jonathan Nieder [Fri, 20 Jul 2018 07:48:22 +0000 (00:48 -0700)]
RepoCommand: record remote branch, group, shallow bit by default

Propagating more information from the manifest to the superproject
tends to work out well.  These particular settings mean:

Recording the remote branch in .gitmodules allows
- "git submodule update --remote" to fetch the right branch
- Gerrit's submodule subscription feature to subscribe from the
  right branch, if requested

Recording groups in .gitattributes allows commands like "git clone
--recurse-submodules=:(attr:platform-linux) $superproject" to clone
the correct set of projects.

Recording the shallow bit in .gitmodules means that "git clone
--recurse-submodules" will use shallow clone in submodules where that
was requested in the manifest.

Gerrit's supermanifest plugin records the remote branch and shallow
bit by default already, and most users of that plugin configure it to
record groups in .gitattributes as well, so for most users this will
be a no-op.

Change-Id: Id2ed47cbca5ce822bde517494673c86ab8c58da9
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge "Ensure RacyGitTests don't raise false negatives"
Jonathan Nieder [Fri, 20 Jul 2018 07:25:26 +0000 (03:25 -0400)]
Merge "Ensure RacyGitTests don't raise false negatives"

6 years agoResolveMerger: don't try needlessly to delete directories 22/126222/4
Thomas Wolf [Wed, 18 Jul 2018 07:47:32 +0000 (09:47 +0200)]
ResolveMerger: don't try needlessly to delete directories

Don't try to delete folders if the merger chooses THEIRS, but all of
BASE, OURS, and THEIRS contain the folder.

Add a test for rebase with auto-stash and subdirectories that
verifies this case. The needless directory deletion and reporting
such directories in getModifiedFiles() was the root cause of bug
536880.

Note even with this fix, bug 536880 will not be fixed in all cases
yet. There may still be cases where the set of modified files ends
up containing directories. This will be dealt with in EGit where
this set is used. (See https://git.eclipse.org/r/#/c/126242/ .)

Bug: 536880
Change-Id: I62b4571a1c1d4415934a6cb4270e0c8036deb2e9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
6 years agoEnsure RacyGitTests don't raise false negatives 60/126160/1
Christian Halstrick [Tue, 17 Jul 2018 10:00:04 +0000 (12:00 +0200)]
Ensure RacyGitTests don't raise false negatives

RacyGitTests depend on filesystem timer resolution. We wait for a file
system timer tick, remember that time as t1, modify a file and assume
that this file has a lastmodified of t1.

If this assumption is not fulfilled then ignore the test result.

Bug: 526111
Change-Id: Ia38b7d2f99171ef54b8f9fe5be343cf9fcfd3971

6 years agoGC: Trim more EWAHCompressedBitmaps to free unused memory 42/126142/2
Terry Parker [Mon, 16 Jul 2018 20:58:30 +0000 (13:58 -0700)]
GC: Trim more EWAHCompressedBitmaps to free unused memory

04b9f4436 fixed places where compressed bitmaps were holding on to their
full buffers, but missed this StoredBitmap.getBitmap() case where a
bitmap is resonstituted from an xor chain.

Change-Id: I7cf75d9e49c18a1a8a880a4df7e821502edc68a4
Signed-off-by: Terry Parker <tparker@google.com>
6 years agoAdd API to specify the submodule name 87/125987/3
Masaya Suzuki [Thu, 12 Jul 2018 15:32:32 +0000 (08:32 -0700)]
Add API to specify the submodule name

Currently SubmoduleAddCommand always uses the path as submodule name.
This patch lets the caller specify a submodule name.

SubmoduleUpdateCommand still does not make use of the submodule name
(see bug 535027) but Git does.  To avoid triggering CVE-2018-11235,
do some validation on the name to avoid '..' path components.

[jn: fleshed out commit message, mostly to work around flaky CI]

Change-Id: I6879c043c6d7973556e2080387f23c246e3d76a5
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMake Reftable seek* and has* method names more consistent 08/125908/7
Minh Thai [Tue, 10 Jul 2018 19:41:23 +0000 (12:41 -0700)]
Make Reftable seek* and has* method names more consistent

Make the method names more consistent and their semantics simpler:
hasRef and seekRef to look up a single exact reference by name and
hasRefsByPrefix and seekRefsByPrefix to look up multiple references by
name prefix.

In particular, splitting hasRef into two separate methods for its
different uses makes DfsReftableDatabase.isNameConflicting easier to
follow.

[jn: fleshed out commit message]

Change-Id: I71106068ff3ec4f7e14dd9eb6ee6b5fab8d14d0b
Signed-off-by: Minh Thai <mthai@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoSeek references by prefix in reftable 98/125898/4
Minh Thai [Tue, 10 Jul 2018 19:41:23 +0000 (12:41 -0700)]
Seek references by prefix in reftable

Reftable implementation of RefDatabase.getRefsByPrefix() should be
more performant, as references are filtered directly by prefix;
instead of fetching the whole subtree then filter by prefix.

Change-Id: If4f5f8c08285ea1eaec9efb83c3d864cea7a1321
Signed-off-by: Minh Thai <mthai@google.com>
6 years agoGC: Trim EWAHCompressedBitmaps to free unused memory 48/125848/3
Terry Parker [Tue, 10 Jul 2018 00:42:21 +0000 (17:42 -0700)]
GC: Trim EWAHCompressedBitmaps to free unused memory

The "Building bitmaps" GC phase fails for large repositories (repos with
10M objects use 1.25MB per uncompressed bitmap, and those with long
histories may build >25k bitmaps). Since these bitmaps xor well against
each other, the actual space needed for each compressed bitmap is
usually no more than a few KB. Calling trim() will ensure we aren't
holding on to excess memory.

Change-Id: I40bf78c730b9f6051da6025f9777ce27220a5b0a
Signed-off-by: Terry Parker <tparker@google.com>