summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/t5544-pack-objects-hook.sh10
-rw-r--r--upload-pack.c9
2 files changed, 11 insertions, 8 deletions
diff --git a/t/t5544-pack-objects-hook.sh b/t/t5544-pack-objects-hook.sh
index 4357af1..dd5f44d 100755
--- a/t/t5544-pack-objects-hook.sh
+++ b/t/t5544-pack-objects-hook.sh
@@ -59,4 +59,14 @@ 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=allow-any --no-object-names --all >objects &&
+ git -C dst.git cat-file --batch-check="%(objecttype)" <objects >types &&
+ ! grep blob types
+'
+
test_done
diff --git a/upload-pack.c b/upload-pack.c
index 4ab55ce..abadc93 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -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++)