summaryrefslogtreecommitdiff
path: root/iterator.h
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2019-03-26 19:31:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-01 06:35:56 (GMT)
commit1339078f5e670e5eb084a4a64c81a0d0b5f1e223 (patch)
treed5aa57d8e3b2a959bb9ff4343db877c9875e4893 /iterator.h
parent1e7d440b0a07ec8e71c107d0950ed1dc43b4d20c (diff)
downloadgit-1339078f5e670e5eb084a4a64c81a0d0b5f1e223.zip
git-1339078f5e670e5eb084a4a64c81a0d0b5f1e223.tar.gz
git-1339078f5e670e5eb084a4a64c81a0d0b5f1e223.tar.bz2
fetch-pack: respect --no-update-shallow in v2
In protocol v0, when sending "shallow" lines, the server distinguishes between lines caused by the remote repo being shallow and lines caused by client-specified depth settings. Unless "--update-shallow" is specified, there is a difference in behavior: refs that reach the former "shallow" lines, but not the latter, are rejected. But in v2, the server does not, and the client treats all "shallow" lines like lines caused by client-specified depth settings. Full restoration of v0 functionality is not possible without protocol change, but we can implement a heuristic: if we specify any depth setting, treat all "shallow" lines like lines caused by client-specified depth settings (that is, unaffected by "--no-update-shallow"), but otherwise, treat them like lines caused by the remote repo being shallow (that is, affected by "--no-update-shallow"). This restores most of v0 behavior, except in the case where a client fetches from a shallow repository with depth settings. This patch causes a test that previously failed with GIT_TEST_PROTOCOL_VERSION=2 to pass. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'iterator.h')
0 files changed, 0 insertions, 0 deletions