diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2019-03-26 12:31:21 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-04-01 15:35:56 +0900 |
commit | 1339078f5e670e5eb084a4a64c81a0d0b5f1e223 (patch) | |
tree | d5aa57d8e3b2a959bb9ff4343db877c9875e4893 /builtin/branch.c | |
parent | fetch-pack: call prepare_shallow_info only if v0 (diff) | |
download | tgif-1339078f5e670e5eb084a4a64c81a0d0b5f1e223.tar.xz |
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 'builtin/branch.c')
0 files changed, 0 insertions, 0 deletions