Skip to content

Commit c2a499e

Browse files
committed
Merge branch 'jh/partial-clone'
Hotfix. * jh/partial-clone: upload-pack: disable object filtering when disabled by config unpack-trees: release oid_array after use in check_updates()
2 parents 03df495 + c7620bd commit c2a499e

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Documentation/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3364,7 +3364,7 @@ uploadpack.packObjectsHook::
33643364
stdout.
33653365

33663366
uploadpack.allowFilter::
3367-
If this option is set, `upload-pack` will advertise partial
3367+
If this option is set, `upload-pack` will support partial
33683368
clone and partial fetch object filtering.
33693369
+
33703370
Note that this configuration variable is ignored if it is seen in the

unpack-trees.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ static int check_updates(struct unpack_trees_options *o)
391391
fetch_objects(repository_format_partial_clone,
392392
&to_fetch);
393393
fetch_if_missing = fetch_if_missing_store;
394+
oid_array_clear(&to_fetch);
394395
}
395396
for (i = 0; i < index->cache_nr; i++) {
396397
struct cache_entry *ce = index->cache[i];

upload-pack.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static int stateless_rpc;
6969
static const char *pack_objects_hook;
7070

7171
static int filter_capability_requested;
72-
static int filter_advertise;
72+
static int allow_filter;
7373
static struct list_objects_filter_options filter_options;
7474

7575
static void reset_timeout(void)
@@ -846,7 +846,7 @@ static void receive_needs(void)
846846
no_progress = 1;
847847
if (parse_feature_request(features, "include-tag"))
848848
use_include_tag = 1;
849-
if (parse_feature_request(features, "filter"))
849+
if (allow_filter && parse_feature_request(features, "filter"))
850850
filter_capability_requested = 1;
851851

852852
o = parse_object(&oid_buf);
@@ -976,7 +976,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
976976
" allow-reachable-sha1-in-want" : "",
977977
stateless_rpc ? " no-done" : "",
978978
symref_info.buf,
979-
filter_advertise ? " filter" : "",
979+
allow_filter ? " filter" : "",
980980
git_user_agent_sanitized());
981981
strbuf_release(&symref_info);
982982
} else {
@@ -1056,7 +1056,7 @@ static int upload_pack_config(const char *var, const char *value, void *unused)
10561056
if (!strcmp("uploadpack.packobjectshook", var))
10571057
return git_config_string(&pack_objects_hook, var, value);
10581058
} else if (!strcmp("uploadpack.allowfilter", var)) {
1059-
filter_advertise = git_config_bool(var, value);
1059+
allow_filter = git_config_bool(var, value);
10601060
}
10611061
return parse_hide_refs_config(var, value, "uploadpack");
10621062
}

0 commit comments

Comments
 (0)