diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2020-09-28 15:26:38 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-28 16:11:59 -0700 |
commit | 23547c40518ac04a20acf2f688114f5d97b61f24 (patch) | |
tree | 83863e1707a8a30b70d09d9c3fc4aff71239d66c /t | |
parent | promisor-remote: remove unused variable (diff) | |
download | tgif-23547c40518ac04a20acf2f688114f5d97b61f24.tar.xz |
fetch: do not override partial clone filter
When a fetch with the --filter argument is made, the configured default
filter is set even if one already exists. This change was made in
5e46139376 ("builtin/fetch: remove unique promisor remote limitation",
2019-06-25) - in particular, changing from:
* If this is the FIRST partial-fetch request, we enable partial
* on this repo and remember the given filter-spec as the default
* for subsequent fetches to this remote.
to:
* If this is a partial-fetch request, we enable partial on
* this repo if not already enabled and remember the given
* filter-spec as the default for subsequent fetches to this
* remote.
(The given filter-spec is "remembered" even if there is already an
existing one.)
This is problematic whenever a lazy fetch is made, because lazy fetches
are made using "git fetch --filter=blob:none", but this will also happen
if the user invokes "git fetch --filter=<filter>" manually. Therefore,
restore the behavior prior to 5e46139376, which writes a filter-spec
only if the current fetch request is the first partial-fetch one (for
that remote).
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5601-clone.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 15fb64c18d..4631f019fe 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -669,7 +669,8 @@ test_expect_success 'partial clone' ' test_expect_success 'partial clone with -o' ' partial_clone_server server && - git clone -o blah --filter=blob:limit=0 "file://$(pwd)/server" client + git clone -o blah --filter=blob:limit=0 "file://$(pwd)/server" client && + test_cmp_config -C client "blob:limit=0" --get-all remote.blah.partialclonefilter ' test_expect_success 'partial clone: warn if server does not support object filtering' ' |