]> source.dussan.org Git - jgit.git/commit
UploadPack: do not check reachability of visible SHA1s 96/193496/11
authorLuca Milanesio <luca.milanesio@gmail.com>
Thu, 19 May 2022 10:12:28 +0000 (11:12 +0100)
committerLuca Milanesio <luca.milanesio@gmail.com>
Sat, 25 Jun 2022 10:45:05 +0000 (06:45 -0400)
commit66ace4b9af137466a4dd6187a11e473351c306a8
tree66dd717aacc9ceb32bbab9a76934a16bb8d3c4ce
parentf4cbf31ae4350f5df0f54401ba10fb9b84ec31e2
UploadPack: do not check reachability of visible SHA1s

When JGit needs to serve a Git client requesting SHA1s
during the want phase, it needs to make a full reachability
check from the advertised refs to the ones requested to
keep all objects in the correct scope of confidentiality
allowed by the avertised refs.

The check is also performed when the SHA1 corresponds to
one of the tips of the advertised refs which is a waste of
resources.

Example:

fetch> ref-prefix refs/heads/foo
fetch< 900505eb8ce8ced2a1757906da1b25c357b9654e refs/heads/foo
fetch< 0000
fetch> command=fetch
fetch> 0001
fetch> thin-pack
fetch> ofs-delta
fetch> want 900505eb8ce8ced2a1757906da1b25c357b9654e

The SHA1 in the want is the tip of refs/heads/foo and therefore
the full reachability check can be shortened and resolved more
quickly.

Change-Id: I49bd9e2464e0bd3bca2abf14c6e9df550d07383b
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java