transport-helper: pass --signed-tags=warn-strip to fast-export

Currently, attempting to push a signed tag to a remote helper which uses fast-export results in the remote helper failing because the default fast-export action for signed tags is "abort". This is not helpful for users because there is no way to pass additional arguments to fast-export here, either from the remote helper or from the command line. In general, the signature will be invalidated by whatever transformation a remote helper performs on a tag to push it to a repository in a different format so the correct behaviour is to strip the tag. Doing this silently may surprise people, so use "warn-strip" to issue a warning when a signed tag is encountered. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

John Keeping committed Apr 14, 2013 at 11:57 UTC b8bd826f3a4196bc80a3c957503b421709b401ab
2 files changed +12 -1
t/t5801-remote-helpers.sh
+10
@@ -6,6 +6,7 @@
6 test_description='Test remote-helper import and export commands'
7
8 . ./test-lib.sh
9 +. "$TEST_DIRECTORY"/lib-gpg.sh
10
11 if ! type "${BASH-bash}" >/dev/null 2>&1; then
12 skip_all='skipping remote-testgit tests, bash not available'
@@ -166,4 +167,13 @@ test_expect_success 'push ref with existing object' '
167 compare_refs local dup server dup
168 '
169
170 +test_expect_success GPG 'push signed tag' '
171 + (cd local &&
172 + git checkout master &&
173 + git tag -s -m signed-tag signed-tag &&
174 + git push origin signed-tag
175 + ) &&
176 + compare_refs local signed-tag^{} server signed-tag^{}
177 +'
178 +
179 test_done
transport-helper.c
+2 -1
@@ -410,9 +410,10 @@ static int get_exporter(struct transport *transport,
410 /* we need to duplicate helper->in because we want to use it after
411 * fastexport is done with it. */
412 fastexport->out = dup(helper->in);
413 - fastexport->argv = xcalloc(5 + revlist_args->nr, sizeof(*fastexport->argv));
413 + fastexport->argv = xcalloc(6 + revlist_args->nr, sizeof(*fastexport->argv));
414 fastexport->argv[argc++] = "fast-export";
415 fastexport->argv[argc++] = "--use-done-feature";
416 + fastexport->argv[argc++] = "--signed-tags=warn-strip";
417 if (data->export_marks)
418 fastexport->argv[argc++] = data->export_marks;
419 if (data->import_marks)