]> source.dussan.org Git - jgit.git/log
jgit.git
6 years agoParse signature of GPG-signed commits 69/124569/6
David Turner [Fri, 15 Jun 2018 00:05:38 +0000 (20:05 -0400)]
Parse signature of GPG-signed commits

In order to support GPG-signed commits, add some methods which will
allow GPG signatures to be parsed out of RevCommit objects.

Later, we can add code to verify the signatures.

Change-Id: Ifcf6b3ac79115c15d3ec4b4eaed07315534d09ac
Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoDeprecate Constants.CHARSET in favor of StandardCharsets.UTF_8 87/128587/1
David Pursehouse [Tue, 4 Sep 2018 01:53:10 +0000 (10:53 +0900)]
Deprecate Constants.CHARSET in favor of StandardCharsets.UTF_8

Change-Id: I3b748620f067582afef20f144feebe40d0332be2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoSimplify file creation in ResetCommandTest 84/128584/1
René Scheibe [Mon, 3 Sep 2018 21:21:10 +0000 (23:21 +0200)]
Simplify file creation in ResetCommandTest

Use existing test utility methods instead of nested PrintWriter usage.

Change-Id: I324852c7971ae644fa499f377a31d1cf265c7fd9
Signed-off-by: René Scheibe <rene.scheibe@gmail.com>
6 years agoSpecify charset when constructing InputStreamReader 40/128240/4
David Pursehouse [Wed, 29 Aug 2018 04:49:35 +0000 (13:49 +0900)]
Specify charset when constructing InputStreamReader

ErrorProne warns [1] about implicit use of the platform default charset,
which can result in differing behaviour between JVM executions or
incorrect behavior if the encoding of the data source doesn't match
expectations.

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

Change-Id: I0fd489d352170339c3867355cd24324dfdbd4b59
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUpdate Orbit to S20180829155938 for 2018-09 RC1 85/128485/1
Matthias Sohn [Sat, 1 Sep 2018 06:22:52 +0000 (08:22 +0200)]
Update Orbit to S20180829155938 for 2018-09 RC1

Change-Id: I48d5a2e06e2833c9745cb71c53600da3ed5f8501
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge "Replace useminimalnegotation flag with maxhaves flag"
Jonathan Nieder [Sat, 1 Sep 2018 00:02:51 +0000 (20:02 -0400)]
Merge "Replace useminimalnegotation flag with maxhaves flag"

6 years agoReplace useminimalnegotation flag with maxhaves flag 83/128483/3
Minh Thai [Fri, 31 Aug 2018 22:54:39 +0000 (15:54 -0700)]
Replace useminimalnegotation flag with maxhaves flag

Client will stop sending haves when the number of haves sent reaches maxhaves.

Change-Id: I1e5b1525be4c67f20a81ca24a2770c20eb5c1271
Signed-off-by: Minh Thai <mthai@google.com>
6 years agoExtract protocol v2 fetch request parsing to its own class 97/128397/8
Ivan Frade [Mon, 27 Aug 2018 18:00:41 +0000 (11:00 -0700)]
Extract protocol v2 fetch request parsing to its own class

The parsing code for protocol v2 fetch doesn't have any dependency on
the rest of UploadPack.

Move it to its own class. This makes testing easier (no need to
instantiate the full UploadPack), simplifies the code in UploadPack and
increases modularity.

At the moment, the parser needs to know about the reference database to
validate incoming references. This dependency could be easily removed
moving the validation later in the flow, after the parsing, where other
validations are already happening. Postponing that to keep this patch
about moving unmodified code around.

Change-Id: I7ad29a6b99caa7c12c06f5a7f30ab6a5f6e44dc7
Signed-off-by: Ivan Frade <ifrade@google.com>
6 years agoFetchV2Request: Rename shallowSince to deepenSince 78/128478/1
Jonathan Nieder [Fri, 31 Aug 2018 20:07:45 +0000 (13:07 -0700)]
FetchV2Request: Rename shallowSince to deepenSince

This fetch parameter is called deepen-since in the protocol.  Call it
the same thing in the request object to make the code easier to reason
about.

This doesn't touch UploadPack#shallowSince, which is likely to be
eliminated altogether in a later patch anyway.

Change-Id: I8ef34bc7ad12fae3a9057ae951367cc024e1a1cb
Suggested-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoFetchV2Request: Correct typo in parameter name 77/128477/1
Jonathan Nieder [Fri, 31 Aug 2018 20:03:29 +0000 (13:03 -0700)]
FetchV2Request: Correct typo in parameter name

There is an extra 'd' in deependNotRefs.  Noticed during code review.

Change-Id: I93d8d7951fe5c351b62e23bdf5bad0ebd631017d
Signed-off-by: Jonathan Nieder <jrn@google.com>
6 years agoMerge "FetchV2Request round up (doneReceived, renamings)"
Jonathan Nieder [Fri, 31 Aug 2018 18:11:59 +0000 (14:11 -0400)]
Merge "FetchV2Request round up (doneReceived, renamings)"

6 years agoFetchV2Request round up (doneReceived, renamings) 44/128144/4
Ivan Frade [Mon, 27 Aug 2018 17:14:27 +0000 (10:14 -0700)]
FetchV2Request round up (doneReceived, renamings)

Make "doneReceived" a member of the fetch request. It indicates if the
"done" line has been received (so it makes sense there) and makes all
the code after the parsing depend only on the request.

Rename "shallowExcludeRefs" to "deepenNot". Those refs come in
"deepen-not" lines in the protocol, and this name makes clearer the
intention.

Change-Id: I7bec65de04930277266491d278de7c3af7d8cbe6
Signed-off-by: Ivan Frade <ifrade@google.com>
6 years agoMerge branch 'stable-5.1' 11/128411/1
David Pursehouse [Fri, 31 Aug 2018 07:54:33 +0000 (16:54 +0900)]
Merge branch 'stable-5.1'

* stable-5.1:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: Ie9d77a7716591246b87fb59ac85214417fe8309d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-5.0' into stable-5.1 08/128408/1
David Pursehouse [Fri, 31 Aug 2018 07:10:49 +0000 (16:10 +0900)]
Merge branch 'stable-5.0' into stable-5.1

* stable-5.0:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I7c2fc7d694d7d891cac96cb805c89c8bdf7c5cbf
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.11' into stable-5.0 07/128407/1
David Pursehouse [Fri, 31 Aug 2018 06:44:15 +0000 (15:44 +0900)]
Merge branch 'stable-4.11' into stable-5.0

* stable-4.11:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I5ebb1058927ea5a478eae9e44b7d96f123a22523
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.10' into stable-4.11 04/128404/1
David Pursehouse [Fri, 31 Aug 2018 06:21:10 +0000 (15:21 +0900)]
Merge branch 'stable-4.10' into stable-4.11

* stable-4.10:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I500dd4e63302abb19ad669988b3a427cef8ef3d4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.9' into stable-4.10 03/128403/1
David Pursehouse [Fri, 31 Aug 2018 04:57:40 +0000 (13:57 +0900)]
Merge branch 'stable-4.9' into stable-4.10

* stable-4.9:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I37e936de0c06d4b9f17724ac4f1feb83f6c15ae3
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.8' into stable-4.9 02/128402/1
David Pursehouse [Fri, 31 Aug 2018 04:08:29 +0000 (13:08 +0900)]
Merge branch 'stable-4.8' into stable-4.9

* stable-4.8:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I17436237cd66ca1c2800ad5ab0142f4a2bc07328
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-4.7' into stable-4.8 01/128401/1
David Pursehouse [Fri, 31 Aug 2018 00:24:57 +0000 (09:24 +0900)]
Merge branch 'stable-4.7' into stable-4.8

* stable-4.7:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: I414ade902dc38b696c566dd604000e3d289f3973
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoUse right variable in error message about depth 93/128393/5
Ivan Frade [Thu, 30 Aug 2018 19:44:51 +0000 (12:44 -0700)]
Use right variable in error message about depth

When this exception is thrown, the `depth` member variable isn't set
yet, resulting in a confusing error message: "Invalid depth: 0".

Change-Id: I8a2bd5e1d9bec00acb0b8857bbf6821e95bf1369
Signed-off-by: Ivan Frade <ifrade@google.com>
6 years agoMerge "UploadPack: avoid conflating shallow commit lists in protocol v2"
Jonathan Nieder [Thu, 30 Aug 2018 21:19:38 +0000 (17:19 -0400)]
Merge "UploadPack: avoid conflating shallow commit lists in protocol v2"

6 years agoUploadPack: avoid conflating shallow commit lists in protocol v2 45/128345/4
Ivan Frade [Wed, 29 Aug 2018 23:36:42 +0000 (16:36 -0700)]
UploadPack: avoid conflating shallow commit lists in protocol v2

At the moment there are two copies of the client shallow commit list:
one in the request and another in the clientShallowCommits member of
the class.

The verifyShallowCommit function was removing missing object ids
from the member but not the request list, and code afterwards was
using the request's version.

In practice, this didn't cause trouble because these shallow commits
are used as endpoint for a walk, and missing ids are just never reached.

Change-Id: I70a8f1fd46de135da09f16e5d954693c8438ffcb
Signed-off-by: Ivan Frade <ifrade@google.com>
6 years agoBazel: Use hyphen instead of underscore in external repository names 54/128354/1
David Pursehouse [Wed, 29 Aug 2018 23:48:41 +0000 (08:48 +0900)]
Bazel: Use hyphen instead of underscore in external repository names

Recent Bazel versions support the hyphen character in external
repository names. On the Gerrit project, the repository names
were harmonized to consistently use hyphen.

As a side effect, it is no longer possible to build jgit from source
in the gerrit tree, due to the different repository names.

Rename the dependencies to use hyphens, consistent with gerrit.

Change-Id: Ideebd858ddd3f0e6f765643001642dfb6c12441f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoBazel: Format all build files with buildifier 0.15.0 53/128353/1
David Pursehouse [Thu, 30 Aug 2018 06:27:20 +0000 (15:27 +0900)]
Bazel: Format all build files with buildifier 0.15.0

Change-Id: I8343b723da6e40d5ae7fc45c84f64c31276bd5dc
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoChangeIdUtilTest: Remove unused notestCommitDashV 51/128351/1
David Pursehouse [Sat, 30 Sep 2017 09:56:42 +0000 (10:56 +0100)]
ChangeIdUtilTest: Remove unused notestCommitDashV

This test was never being run. Since it was introduced it was
named "notest.." which meant it didn't run with JUnit3, and
since it is not annotated @Test it also doesn't run with JUnit4.

When compiling with Bazel 0.6.0, error-prone raises an error
that the public method is not annotated with @Ignore or @Test.

Given that the test has never been run anyway, we can just
remove it.

Bug: 525415
Change-Id: Ie9a54f89fe42e0c201f547ff54ff1d419ce37864
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoBazel: Use hyphen instead of underscore in external repository names 48/128348/2
David Pursehouse [Wed, 29 Aug 2018 23:48:41 +0000 (08:48 +0900)]
Bazel: Use hyphen instead of underscore in external repository names

Recent Bazel versions support the hyphen character in external
repository names. On the Gerrit project, the repository names
were harmonized to consistently use hyphen.

As a side effect, it is no longer possible to build jgit from source
in the gerrit tree, due to the different repository names.

Rename the dependencies to use hyphens, consistent with gerrit.

Change-Id: Ideebd858ddd3f0e6f765643001642dfb6c12441f
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoFormat BUILD files with buildifier 0.15.0 47/128347/1
David Pursehouse [Wed, 29 Aug 2018 23:50:37 +0000 (08:50 +0900)]
Format BUILD files with buildifier 0.15.0

Change-Id: I6200b0040d24da86968c688f45a2056343e182be
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge branch 'stable-5.1' 42/128342/1
Matthias Sohn [Wed, 29 Aug 2018 21:20:52 +0000 (23:20 +0200)]
Merge branch 'stable-5.1'

* stable-5.1:
  Adjust severity of missing execution environment for LFS
  Prepare 5.1.0-SNAPSHOT builds
  JGit v5.1.0.201808281540-m3

Change-Id: Iebe26d872b92a347eea479a136a4a2bac726b0bb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoAdjust severity of missing execution environment for LFS 81/128281/2
Markus Duft [Wed, 29 Aug 2018 11:08:25 +0000 (13:08 +0200)]
Adjust severity of missing execution environment for LFS

All other JGit bundles use severity warning for missing execution
environment definition. Use the same configuration for LFS bundles.

Bug: 488123
Change-Id: I575d6d61418f5c4e39303fb8a9cd69e6539f6b5e
Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
6 years agoPrepare 5.1.0-SNAPSHOT builds 86/128286/1
Matthias Sohn [Wed, 29 Aug 2018 11:51:08 +0000 (13:51 +0200)]
Prepare 5.1.0-SNAPSHOT builds

Change-Id: If57fcce14f5ba3ef2a2602515e2f89b8f22a742b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUpgrade maven-compiler-plugin to 3.8.0 38/128238/1
David Pursehouse [Wed, 29 Aug 2018 04:02:52 +0000 (13:02 +0900)]
Upgrade maven-compiler-plugin to 3.8.0

Change-Id: I545095f9ee7481c73765d029f9a32edf01625893
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoJGit v5.1.0.201808281540-m3 31/128231/1 v5.1.0.201808281540-m3
Matthias Sohn [Tue, 28 Aug 2018 19:41:37 +0000 (21:41 +0200)]
JGit v5.1.0.201808281540-m3

Change-Id: Ie86c46a828b55a2235056b9a5bc2c6c450b95ed0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoUpdate Orbit to S20180820175350 for 2018-09 M3 25/128225/1
Matthias Sohn [Tue, 28 Aug 2018 19:02:09 +0000 (21:02 +0200)]
Update Orbit to S20180820175350 for 2018-09 M3

Change-Id: Ifecbe9a7f36e65a191f007f0216633e9038ebff9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoAdd ls-files CLI command 86/104686/8
Matthias Sohn [Thu, 7 Sep 2017 23:47:21 +0000 (01:47 +0200)]
Add ls-files CLI command

Implement the basic functionality and support the option --help (-h).

Change-Id: Ibcdf0c958d0f93b7415d4e591b1455ccba5d95f7
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoMerge branch 'stable-5.0' 11/128111/2
David Pursehouse [Mon, 27 Aug 2018 08:05:23 +0000 (17:05 +0900)]
Merge branch 'stable-5.0'

* stable-5.0:
  Fix NoSuchFileException in GC.deleteTempPacksIdx()
  Fix NoSuchFileException during directory cleanup in RefDirectory

Change-Id: I35bd4bcbeac2430f674ccb6b947ac3776cec8a82
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
6 years agoMerge "Externalize warning message in RefDirectory.delete()"
Matthias Sohn [Mon, 27 Aug 2018 19:05:09 +0000 (15:05 -0400)]
Merge "Externalize warning message in RefDirectory.delete()"

6 years agoMerge "Cleanup existing tests"
Christian Halstrick [Mon, 27 Aug 2018 11:16:58 +0000 (07:16 -0400)]
Merge "Cleanup existing tests"

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 agoFix NoSuchFileException in GC.deleteTempPacksIdx() 95/128095/2
Matthias Sohn [Sun, 26 Aug 2018 23:20:31 +0000 (01:20 +0200)]
Fix NoSuchFileException in GC.deleteTempPacksIdx()

This exception is thrown in GC.deleteTempPacksIdx() if the repository
has no packs.

Bug: 538286
Change-Id: Ieb482be751226baf0843068a0f847e0cdc6e0cb6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
6 years agoFix NoSuchFileException during directory cleanup in RefDirectory 94/128094/2
Matthias Sohn [Sun, 26 Aug 2018 23:13:38 +0000 (01:13 +0200)]
Fix NoSuchFileException during directory cleanup in RefDirectory

Bug: 538285
Change-Id: Iab5c381a412cb2c2176af55189668c267ed29fbc
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 agoCleanup existing tests 67/127967/3
René Scheibe [Thu, 23 Aug 2018 21:42:02 +0000 (23:42 +0200)]
Cleanup existing tests

Renamed and restructured tests for improved clarity.

Bug: 479266
Change-Id: Ic9d05ddf722bddd148fa9d9c19248dd53d97f1e4
Signed-off-by: René Scheibe <rene.scheibe@gmail.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>