Skip to content

Commit a5e74b4

Browse files
committed
Merge branch 'jk/check-config-parsing-error-in-upload-pack'
Tighten error checking in the codepath that responds to "git fetch". * jk/check-config-parsing-error-in-upload-pack: upload-pack: propagate return value from object filter config callback
2 parents aa35dad + d43a21b commit a5e74b4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

t/t5616-partial-clone.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ test_expect_success 'implicitly construct combine: filter with repeated flags' '
251251
test_cmp unique_types.expected unique_types.actual
252252
'
253253

254+
test_expect_success 'upload-pack complains of bogus filter config' '
255+
printf 0000 |
256+
test_must_fail git \
257+
-c uploadpackfilter.tree.maxdepth \
258+
upload-pack . >/dev/null 2>err &&
259+
test_i18ngrep "unable to parse.*tree.maxdepth" err
260+
'
261+
254262
test_expect_success 'upload-pack fails banned object filters' '
255263
test_config -C srv.bare uploadpackfilter.blob:none.allow false &&
256264
test_must_fail ok=sigpipe git clone --no-checkout --filter=blob:none \

upload-pack.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,8 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data)
13291329
return git_config_string(&data->pack_objects_hook, var, value);
13301330
}
13311331

1332-
parse_object_filter_config(var, value, data);
1332+
if (parse_object_filter_config(var, value, data) < 0)
1333+
return -1;
13331334

13341335
return parse_hide_refs_config(var, value, "uploadpack");
13351336
}

0 commit comments

Comments
 (0)