Skip to content

Commit 77c4c60

Browse files
committed
Merge branch 'jt/keep-partial-clone-filter-upon-lazy-fetch' into next
The lazy fetching done internally to make missing objects available in a partial clone incorrectly made permanent damage to the partial clone filter in the repository, which has been corrected. * jt/keep-partial-clone-filter-upon-lazy-fetch: fetch: do not override partial clone filter promisor-remote: remove unused variable
2 parents 440a7a0 + 23547c4 commit 77c4c60

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

builtin/fetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ static inline void fetch_one_setup_partial(struct remote *remote)
16841684
* If this is a partial-fetch request, we enable partial on
16851685
* this repo if not already enabled and remember the given
16861686
* filter-spec as the default for subsequent fetches to this
1687-
* remote.
1687+
* remote if there is currently no default filter-spec.
16881688
*/
16891689
if (filter_options.choice) {
16901690
partial_clone_register(remote->name, &filter_options);

list-objects-filter-options.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,19 @@ void partial_clone_register(
344344
const char *remote,
345345
struct list_objects_filter_options *filter_options)
346346
{
347+
struct promisor_remote *promisor_remote;
347348
char *cfg_name;
348349
char *filter_name;
349350

350351
/* Check if it is already registered */
351-
if (!promisor_remote_find(remote)) {
352+
if ((promisor_remote = promisor_remote_find(remote))) {
353+
if (promisor_remote->partial_clone_filter)
354+
/*
355+
* Remote is already registered and a filter is already
356+
* set, so we don't need to do anything here.
357+
*/
358+
return;
359+
} else {
352360
if (upgrade_repository_format(1) < 0)
353361
die(_("unable to upgrade repository format to support partial clone"));
354362

promisor-remote.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "strvec.h"
77

88
static char *repository_format_partial_clone;
9-
static const char *core_partial_clone_filter_default;
109

1110
void set_repository_format_partial_clone(char *partial_clone)
1211
{
@@ -100,10 +99,6 @@ static int promisor_remote_config(const char *var, const char *value, void *data
10099
size_t namelen;
101100
const char *subkey;
102101

103-
if (!strcmp(var, "core.partialclonefilter"))
104-
return git_config_string(&core_partial_clone_filter_default,
105-
var, value);
106-
107102
if (parse_config_key(var, "remote", &name, &namelen, &subkey) < 0)
108103
return 0;
109104

promisor-remote.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct object_id;
99
* Promisor remote linked list
1010
*
1111
* Information in its fields come from remote.XXX config entries or
12-
* from extensions.partialclone or core.partialclonefilter.
12+
* from extensions.partialclone.
1313
*/
1414
struct promisor_remote {
1515
struct promisor_remote *next;

t/t5601-clone.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,8 @@ test_expect_success 'partial clone' '
683683

684684
test_expect_success 'partial clone with -o' '
685685
partial_clone_server server &&
686-
git clone -o blah --filter=blob:limit=0 "file://$(pwd)/server" client
686+
git clone -o blah --filter=blob:limit=0 "file://$(pwd)/server" client &&
687+
test_cmp_config -C client "blob:limit=0" --get-all remote.blah.partialclonefilter
687688
'
688689

689690
test_expect_success 'partial clone: warn if server does not support object filtering' '

0 commit comments

Comments
 (0)