Commit Graph

6811 Commits

Author SHA1 Message Date
Jonathan Nieder aaf41a51b7 Move BaseReceivePack#db getter to ReceivePack
Another step toward eliminating BaseReceivePack as a separate API.

Change-Id: If7b7d5c65a043607a2424211adb479fa33a9077b
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-29 11:59:27 +01:00
Jonathan Nieder 937beaa1ae Move BaseReceivePack#pushCert getter and setter to ReceivePack
This is a first step toward eliminating the BaseReceivePack API.

Inspired by a larger change by Dan Wang <dwwang@google.com>.

Change-Id: I5c876a67d8db24bf808823d9ea44d991b1ce5277
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-29 11:59:26 +01:00
Matthias Sohn e78776fa5b Remove unused API problem filters
Change-Id: I8ed98ac60362ba071506b0bdacd2941ab72b6bf4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-29 11:55:02 +01:00
Matthias Sohn bd6aa22333 Silence API error for RefDatabase.getRef declared final
RefDatabase.getRef was declared final in
c1954f6c36
which only affects implementers.

Change-Id: I4c14232a119670d263d88db2b8d725dcdd36ab2a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-29 01:07:24 +01:00
Matthias Sohn 7b989eed72 Suppress API errors and add missing @since tags caused by 6ea888a
Change-Id: Id042d46ba078af35b9c22a079da4ae14fc5fa231
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-29 00:17:33 +01:00
Jonathan Nieder 2f9ebeacc8 Merge changes Id3bb9443,I1be1948b
* changes:
  RefDatabase: Introduce findRef synonym for getRef
  RefDirectory: Look up several exact refs in one shot
2018-12-28 15:57:51 -05:00
Jonathan Nieder b4e415f8a9 Move first line parsing for v0 push out of BaseReceivePack
This simplifies the BaseReceivePack class and decreases its API
surface, which should make merging with ReceivePack easier.

Inspired by 6aca8899a5 (Move first line
parsing for v0/v1 pack negotiation out of UploadPack, 2018-09-17).

Change-Id: I1fc175d15aa7cb5968c26fc83a95480403af617c
2018-12-27 14:07:41 -08:00
Jonathan Nieder c1954f6c36 RefDatabase: Introduce findRef synonym for getRef
Using findRef instead of getRef makes it clearer that the caller wants
to search for the ref in the search path, instead of looking for a ref
that exactly matches the input.

This change introduces the new findRef method and deprecates getRef.
It updates Repository#findRef to use the new method, ensuring some
test coverage.  Other callers will be updated in followup changes.

A nice side effect of introducing the new findRef method is that it is
final and based on firstExactRef, so implementers can focus on
implementing the latter efficiently and do not have to carefully write
custom path search code respecting SEARCH_PATH.

Change-Id: Id3bb944344a9743705fd1f20193ab679298fa51c
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-12-26 20:49:35 -08:00
Jonathan Nieder d2bab65470 RefDirectory: Look up several exact refs in one shot
Override exactRef(String...) and firstExactRef(String...) with
implementations specific to FileRepository.

The specialized implementations are similar to the generic ones from
RefDatabase, but because these use readRef directly instead of
exactRef, they only need to call fireRefsChanged once.

This will allow replacing RefDirectory#getRef with a generic
implementation that uses firstExactRef without hurting performance.

Change-Id: I1be1948bd6121c1a1e8152e201aab97e7fb308bb
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-12-26 20:48:40 -08:00
Jonathan Nieder b2ec6405e4 RefDirectory: Do not use search path to find additional refs
Psuedorefs like FETCH_HEAD and MERGE_HEAD are supposed to be directly
under the .git directory, not in other locations in the SEARCH_PATH
like refs/ and refs/heads/.  Use exactRef to access them.

Change-Id: Iab8ac47008822fa78fc0691e239e518c34d7a98e
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-12-26 19:29:27 -08:00
Matthias Sohn 56562221d6 Prepare 5.2.2-SNAPSHOT builds
Change-Id: I9487f6a59ed684ad13bcfbff7d6c730ae4f37030
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 03:32:48 +01:00
Matthias Sohn 24e89950e7 JGit v5.2.1.201812262042-r
Change-Id: Idfefc54e898f364407a931b787a26db2489b031c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 02:44:17 +01:00
Matthias Sohn a26bf7231e Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Prepare 5.1.6-SNAPSHOT builds
  JGit v5.1.5.201812261915-r

Change-Id: Idab456457200ec46f0e4e22bc6e54401b5b57285
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 01:42:13 +01:00
Matthias Sohn fafad4196d Prepare 5.1.6-SNAPSHOT builds
Change-Id: If3313d602aa57cfa031ba2c9ec03bd51b464dc19
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 01:35:30 +01:00
Matthias Sohn 510011b05c JGit v5.1.5.201812261915-r
Change-Id: I249a440d1ca1c997343da942ae55fcb27a645b92
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-27 01:16:15 +01:00
Jonathan Nieder 9895338de1 RefDatabase: Remove fallback exactRef implementation
This is simpler to implement than getRef.  Make it abstract so
implementers remember to override it.

Change-Id: I5f319be1fb1206d7a0142ea939dc4e1039f850ab
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-12-26 14:33:13 -08:00
Jonathan Nieder f46e223187 RefDirectory: Fire RefsChangedEvent on error, too
getRef and exactRef can produce recoverable exceptions --- for
example, a corrupt loose ref that cannot be parsed.  If readRef was
called and updated looseRefs in the process, RefsChangedEvent should
still be fired.

Noticed while improving the implementation of getRef.  This commit
only affects exactRef and getRef.  Other methods might be similarly
skipping firing RefsChangedEvent in their error handling code, and
this change does not fix them.

Change-Id: I0f460f6c8d9a585ad8453a4a47c1c77e24a1fb83
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-12-26 14:30:42 -08:00
Jonathan Nieder 32da5ac3c3 RefDirectory: Refactor getRef and exactRef to share code
Both getRef and exactRef look for a ref or pseudoref in the $GIT_DIR
directory, with careful error handling to handle non-refs like
.git/config.

Avoid the duplication by factoring out a helper that takes care of
this.  This should make the code easier to understand and manipulate.

Change-Id: I2ea67816d2385e84e2d3394b897e23df5826ba50
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-12-26 14:25:11 -08:00
Jonathan Nieder eb4c63fbbf UploadPack: Filter refs used for deepen-not resolution
Clients can use --shallow-exclude to obtain information about what
commits are reachable from refs they are not supposed to be able to
see.  Plug the hole by allowing the AdvertiseRefsHook and RefFilter to
take effect here, too.

Change-Id: If2b8e95344fa49e10a6a202144318b60d002490e
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-12-26 13:26:39 -08:00
Jonathan Nieder f909de5c44 Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  UploadPack: Avoid calling AdvertiseRefsHook twice
  Prepare 5.1.5-SNAPSHOT builds
  JGit v5.1.4.201812251853-r
  UploadPack: Filter refs used for want-ref resolution
  UploadPack: Defer want-ref resolution to after parsing
  Call AdvertiseRefsHook for protocol v2
  Prepare 4.11.7-SNAPSHOT builds
  JGit v4.11.6.201812241910-r
  Prepare 4.9.9-SNAPSHOT builds
  JGit v4.9.8.201812241815-r
  UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: I5879df9b723a0dbf6a1eff89a34bbb269f3b773d
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-12-26 13:26:23 -08:00
Jonathan Nieder 53ab1188d5 Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  UploadPack: Avoid calling AdvertiseRefsHook twice

Change-Id: Ie9ce67921e38fff8338a148c4d9f2776be01d0b0
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-12-26 13:24:26 -08:00
Jonathan Nieder c961e2d773 UploadPack: Avoid calling AdvertiseRefsHook twice
The AdvertiseRefsHook can be called twice if the following conditions
hold:

 1. This AdvertiseRefsHook doesn't set this.refs.
 2. getAdvertisedOrDefaultRefs is called after getFilteredRefs.

For example, this can happen when fetchV2 is called after lsRefsV2
when using a stateful bidirectional transport.

The second call does not accomplish anything useful.  Guard it with
'if (!advertiseRefsHookCalled)' to avoid wasted work.

Reported-by: Jonathan Tan <jonathantanmy@google.com>
Change-Id: Ib746582e4ef645b767a5b3fb969596df99ac2ab5
Signed-off-by: Jonathan Nieder <jrn@google.com>
2018-12-26 13:19:01 -08:00
Jonathan Nieder f5bdb9745f Merge changes from topic 'update-index-ref-decorator'
* changes:
  RefCursor: Remove unnecessary getUpdateIndex method
  RefDatabase/Ref: Add versioning to reference database
2018-12-26 13:12:14 -05:00
Ivan Frade 3381bf7e6a RefCursor: Remove unnecessary getUpdateIndex method
Now the reference carries its updateIndex, so the cursor doesn't need
to expose it.

Change-Id: Icbfca46f92a13f3d8215ad10b2a166a6f40b0b0f
Signed-off-by: Ivan Frade <ifrade@google.com>
2018-12-26 09:42:59 -08:00
Ivan Frade 6ea888a036 RefDatabase/Ref: Add versioning to reference database
In DFS implementations the reference table can fall out of sync, but
it is not possible to check this situation in the current API.

Add a property to the Refs indicating the order of its updates.  This
version is set only by RefDatabase implementations that support
versioning (e.g reftable based).

Caller is responsible to check if the reference db creates versioned
refs before accessing getUpdateIndex(). E.g:

   Ref ref = refdb.exactRef(...);
   if (refdb.hasVersioning()) {
       ref.getUpdateIndex();
   }

Change-Id: I0d5ec8e8df47c730301b2e12851a6bf3dac9d120
Signed-off-by: Ivan Frade <ifrade@google.com>
2018-12-26 09:42:59 -08:00
Matthias Sohn d14209e81b Prepare 5.1.5-SNAPSHOT builds
Change-Id: I3eeb24b01a4f955e7e933238defb42635ebfec7d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-26 00:57:01 +01:00
Matthias Sohn c93aec2b73 JGit v5.1.4.201812251853-r
Change-Id: I30ba167bcd8144074553d7446a45fa6be19584fe
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-26 00:53:51 +01:00
Jonathan Nieder fcafdcc404 UploadPack: Filter refs used for want-ref resolution
In the longer term, we can add support for this to the
RequestValidator interface.  In the short term, this is a minimal
band-aid to ensure any refs the client requests are visible to the
client.

Change-Id: I0683c7a00e707cf97eef6c6bb782671d0a550ffe
Reported-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-26 00:40:00 +01:00
Jonathan Nieder 1638a2fce8 UploadPack: Defer want-ref resolution to after parsing
ProtocolV2Parser explains:

  // TODO(ifrade): This validation should be done after the
  // protocol parsing. It is not a protocol problem asking for an
  // unexisting ref and we wouldn't need the ref database here.

Do so.  This way all ref database accesses are in one place, in the
UploadPack class.

No user-visible change intended --- this is just to make the code
easier to manipulate.

Change-Id: I68e87dff7b9a63ccc169bd0836e8e8baaf5d1048
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-26 00:39:44 +01:00
Matthias Sohn 25deb30460 Merge branch 'stable-5.0' into stable-5.1
* stable-5.0:
  Call AdvertiseRefsHook for protocol v2
  Prepare 4.11.7-SNAPSHOT builds
  JGit v4.11.6.201812241910-r
  Prepare 4.9.9-SNAPSHOT builds
  JGit v4.9.8.201812241815-r
  UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: Icdc212bf5be2485d0f8028acf6c62fb8531d0e3c
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 23:58:53 +01:00
Masaya Suzuki 8eecb4f8b7 Call AdvertiseRefsHook for protocol v2
AdvertiseRefsHook is used to limit the visibility of the refs in Gerrit.
If this hook is not called, then all refs are treated as visible.

In protocol v2, the hook is not called, causing the server to advertise
all refs.  This bug was introduced in v5.0.0.201805221745-rc1~1^2~9
(Execute AdvertiseRefsHook only for protocol v0 and v1, 2018-05-14).

Even before then, the hook was not called in requests after the
capability advertisement, so in transports like HTTP that do not retain
state between round-trips, the server would advertise all refs in
response to an ls-refs (ls-remote) request.

Fix both cases by using getAdvertisedOrDefaultRefs to retrieve the
advertised refs in lsRefs, ensuring the hook is called in all cases that
use its result.

[jn: backported to stable-5.0; split out from a larger patch that also
 fixes protocol v0; avoided filtering this.refs by ref prefix]

Change-Id: I64bce0e72d15b90baccc235c067e57b6af21b55f
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 23:36:11 +01:00
Matthias Sohn 9caa94239a Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
  Prepare 4.11.7-SNAPSHOT builds
  JGit v4.11.6.201812241910-r
  Prepare 4.9.9-SNAPSHOT builds
  JGit v4.9.8.201812241815-r
  UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: Ie81284ca6d580b0712c49eec610393d0c0c50203
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 23:27:13 +01:00
Matthias Sohn 23e4765a65 Prepare 4.11.7-SNAPSHOT builds
Change-Id: I97dc0f4aeb51c2084f40531ceac84e90bf70608d
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 01:08:03 +01:00
Matthias Sohn cc76de549a JGit v4.11.6.201812241910-r
Change-Id: I21bfe7a76450184bce43cbe8ebcaa7891e4b12ed
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 00:56:54 +01:00
Matthias Sohn affbb99271 Merge branch 'stable-4.10' into stable-4.11
* stable-4.10:
  Prepare 4.9.9-SNAPSHOT builds
  JGit v4.9.8.201812241815-r
  UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: I937e9a4547fc10e4de7c887163022d1ab0322d64
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 00:54:15 +01:00
Matthias Sohn 60a606a261 Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
  Prepare 4.9.9-SNAPSHOT builds
  JGit v4.9.8.201812241815-r
  UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: I2e499f34b1c481af794fa9325b0dfebaccdf3cb0
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 00:41:41 +01:00
Matthias Sohn 8f1fd09bea Prepare 4.9.9-SNAPSHOT builds
Change-Id: I0f7238ce8f79063a410c85701020ffce2b1234cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 00:10:49 +01:00
Matthias Sohn 67af2d46dd JGit v4.9.8.201812241815-r
Change-Id: Ic75e4611cce396b186680bc962f0c73b2ee5fff1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-25 00:01:29 +01:00
Masaya Suzuki 78b18dbb83 UploadPack: Test filtering by AdvertiseRefsHook in stateless transports
AdvertiseRefsHook is used to limit the visibility of the refs in Gerrit.
If this hook is not called, then all refs are treated as visible,
causing the server to serve commits reachable from branches the client
should not be able to access, if asked to via a request naming a guessed
object id.

Until 3a529361a76e8267467071e0b13ebb36b97d8fb2 (Call AdvertiseRefsHook
before validating wants, 2018-12-18), UploadPack would invoke this hook
at ref advertisement time but not during negotiation and when serving a
pack file.  Add a test to avoid regressing. Stateful bidirectional
transports were not affected, so the test uses HTTP.

[jn: split out when backporting the fix to stable-4.5.  The test passes
 as long as v4.9.0.201710071750-r~169 (fetch: Accept any SHA-1 on lhs of
 refspec, 2017-06-04) is cherry picked along with it.]

Change-Id: I8c017107336adc7cb4c826985779676bf043e648
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 23:51:07 +01:00
Matthias Sohn 3dd3fe9ea4 Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: Ib44e314a68bca2349b45f4937257aa1298c8d74b
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 23:36:29 +01:00
Matthias Sohn a65ce1bfd1 Merge branch 'stable-4.7' into stable-4.8
* stable-4.7:
  Prepare 4.7.8-SNAPSHOT builds
  JGit v4.7.7.201812240805-r
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: I68a21067705b580b40840f8039001ff1e5273c15
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 23:27:25 +01:00
Matthias Sohn 391371cad2 Prepare 4.7.8-SNAPSHOT builds
Change-Id: Ic4ab4aae6d87392d1a5a8bbda06384b7a5b64182
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 23:16:19 +01:00
Matthias Sohn 4d32049bb3 JGit v4.7.7.201812240805-r
Change-Id: I57b6001b1fbd6042299ccd4dd7d70765a46ea10b
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 13:50:12 +01:00
Matthias Sohn 193a164925 Merge branch 'stable-4.6' into stable-4.7
* stable-4.6:
  Fix feature versions imported by feature org.eclipse.jgit.pgm
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: If637694f80dbd1e774d60c672fe78a6500650bb8
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 13:25:31 +01:00
Matthias Sohn 2e951b0d3a Fix feature versions imported by feature org.eclipse.jgit.pgm
On stable-4.6 we are currently at version 4.6.2-SNAPSHOT

Change-Id: Ia2972d0697c3476850ecf4a3c6691b3987866cd9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 12:13:29 +01:00
Matthias Sohn 4ad74d2f9b Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
  Prepare 4.5.6-SNAPSHOT builds
  JGit v4.5.5.201812240535-r
  Call AdvertiseRefsHook before validating wants

Change-Id: I0fd67ddd9c4966c20d82cdfe78b2f9d4898b4665
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 12:09:39 +01:00
Matthias Sohn ce76f773f8 Prepare 4.5.6-SNAPSHOT builds
Change-Id: I57c55187ada6d824b94a17f5a79a5bcff61f9ee9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 12:00:26 +01:00
Matthias Sohn 40366c1cf5 JGit v4.5.5.201812240535-r
Change-Id: I6e89e937c08757887967d91afb39cfbe8372d6b5
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 11:21:27 +01:00
Masaya Suzuki 61f0bd54d0 Call AdvertiseRefsHook before validating wants
AdvertiseRefsHook is used to limit the visibility of the refs in Gerrit.
If this hook is not called, then all refs are treated as visible,
causing the server to serve commits reachable from branches the client
should not be able to access, if asked to via a request naming a guessed
object id.

This bug was introduced in v2.0.0.201206130900-r~123 (Modify refs in
UploadPack/ReceivePack using a hook interface, 2012-02-08).  Stateful
bidirectional transports are not affected.

Fix it by moving the AdvertiseRefsHook call to
getAdvertisedOrDefaultRefs, ensuring the hook is called in all cases.

[jn: backported to stable-4.5 by splitting out tests and the protocol v2
 specific parts]

Change-Id: I159f396216354f2eda3968d17802e166d8c8ec2d
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 10:58:43 +01:00
Matthias Sohn 0aa31b110b Update org.tukaani.xz to 1.8.0.v20180207-1613
CQ: 18321
Change-Id: I49f47748e7753146c0d696b2bd381d2d3465691e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 10:11:22 +01:00