Skip to content

Commit

Permalink
Merge branch 'jv/upload-pack-filter-spec-quotefix' into jch
Browse files Browse the repository at this point in the history
* jv/upload-pack-filter-spec-quotefix:
  upload-pack.c: fix filter spec quoting bug
  • Loading branch information
gitster committed Jan 25, 2021
2 parents fda3c3f + e2295f7 commit 2934bb7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 9 additions & 0 deletions t/t5544-pack-objects-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,13 @@ test_expect_success 'hook does not run from repo config' '
test_path_is_missing .git/hook.stdout
'

test_expect_success 'hook works with partial clone' '
clear_hook_results &&
test_config_global uploadpack.packObjectsHook ./hook &&
test_config_global uploadpack.allowFilter true &&
git clone --bare --no-local --filter=blob:none . dst.git &&
git -C dst.git rev-list --objects --missing=print HEAD >objects &&
grep "^?" objects
'

test_done
9 changes: 1 addition & 8 deletions upload-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,7 @@ static void create_pack_file(struct upload_pack_data *pack_data,
if (pack_data->filter_options.choice) {
const char *spec =
expand_list_objects_filter_spec(&pack_data->filter_options);
if (pack_objects.use_shell) {
struct strbuf buf = STRBUF_INIT;
sq_quote_buf(&buf, spec);
strvec_pushf(&pack_objects.args, "--filter=%s", buf.buf);
strbuf_release(&buf);
} else {
strvec_pushf(&pack_objects.args, "--filter=%s", spec);
}
strvec_pushf(&pack_objects.args, "--filter=%s", spec);
}
if (uri_protocols) {
for (i = 0; i < uri_protocols->nr; i++)
Expand Down

0 comments on commit 2934bb7

Please sign in to comment.