Git fork

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()

+6 -5
+1 -1
Documentation/config.txt
··· 3364 stdout. 3365 3366 uploadpack.allowFilter:: 3367 - If this option is set, `upload-pack` will advertise partial 3368 clone and partial fetch object filtering. 3369 + 3370 Note that this configuration variable is ignored if it is seen in the
··· 3364 stdout. 3365 3366 uploadpack.allowFilter:: 3367 + If this option is set, `upload-pack` will support partial 3368 clone and partial fetch object filtering. 3369 + 3370 Note that this configuration variable is ignored if it is seen in the
+1
unpack-trees.c
··· 391 fetch_objects(repository_format_partial_clone, 392 &to_fetch); 393 fetch_if_missing = fetch_if_missing_store; 394 } 395 for (i = 0; i < index->cache_nr; i++) { 396 struct cache_entry *ce = index->cache[i];
··· 391 fetch_objects(repository_format_partial_clone, 392 &to_fetch); 393 fetch_if_missing = fetch_if_missing_store; 394 + oid_array_clear(&to_fetch); 395 } 396 for (i = 0; i < index->cache_nr; i++) { 397 struct cache_entry *ce = index->cache[i];
+4 -4
upload-pack.c
··· 69 static const char *pack_objects_hook; 70 71 static int filter_capability_requested; 72 - static int filter_advertise; 73 static struct list_objects_filter_options filter_options; 74 75 static void reset_timeout(void) ··· 846 no_progress = 1; 847 if (parse_feature_request(features, "include-tag")) 848 use_include_tag = 1; 849 - if (parse_feature_request(features, "filter")) 850 filter_capability_requested = 1; 851 852 o = parse_object(&oid_buf); ··· 976 " allow-reachable-sha1-in-want" : "", 977 stateless_rpc ? " no-done" : "", 978 symref_info.buf, 979 - filter_advertise ? " filter" : "", 980 git_user_agent_sanitized()); 981 strbuf_release(&symref_info); 982 } else { ··· 1056 if (!strcmp("uploadpack.packobjectshook", var)) 1057 return git_config_string(&pack_objects_hook, var, value); 1058 } else if (!strcmp("uploadpack.allowfilter", var)) { 1059 - filter_advertise = git_config_bool(var, value); 1060 } 1061 return parse_hide_refs_config(var, value, "uploadpack"); 1062 }
··· 69 static const char *pack_objects_hook; 70 71 static int filter_capability_requested; 72 + static int allow_filter; 73 static struct list_objects_filter_options filter_options; 74 75 static void reset_timeout(void) ··· 846 no_progress = 1; 847 if (parse_feature_request(features, "include-tag")) 848 use_include_tag = 1; 849 + if (allow_filter && parse_feature_request(features, "filter")) 850 filter_capability_requested = 1; 851 852 o = parse_object(&oid_buf); ··· 976 " allow-reachable-sha1-in-want" : "", 977 stateless_rpc ? " no-done" : "", 978 symref_info.buf, 979 + allow_filter ? " filter" : "", 980 git_user_agent_sanitized()); 981 strbuf_release(&symref_info); 982 } else { ··· 1056 if (!strcmp("uploadpack.packobjectshook", var)) 1057 return git_config_string(&pack_objects_hook, var, value); 1058 } else if (!strcmp("uploadpack.allowfilter", var)) { 1059 + allow_filter = git_config_bool(var, value); 1060 } 1061 return parse_hide_refs_config(var, value, "uploadpack"); 1062 }