summaryrefslogtreecommitdiff
path: root/builtin/fast-export.c
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2013-04-14 10:57:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-15 16:02:25 (GMT)
commitcd16c59bfa216b7e153f357ccfa89d2a567b8c00 (patch)
treecf9bd5bfece3d6d070a1f9a2d6b28490b0539404 /builtin/fast-export.c
parent85e7e81ccfcec98972e341ab81b0109084b84906 (diff)
downloadgit-cd16c59bfa216b7e153f357ccfa89d2a567b8c00.zip
git-cd16c59bfa216b7e153f357ccfa89d2a567b8c00.tar.gz
git-cd16c59bfa216b7e153f357ccfa89d2a567b8c00.tar.bz2
fast-export: add --signed-tags=warn-strip mode
This issues a warning while stripping signatures from signed tags, which allows us to use it as default behaviour for remote helpers which cannot specify how to handle signed tags. Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fast-export.c')
-rw-r--r--builtin/fast-export.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 725c0a7..d60d675 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -24,7 +24,7 @@ static const char *fast_export_usage[] = {
};
static int progress;
-static enum { ABORT, VERBATIM, WARN, STRIP } signed_tag_mode = ABORT;
+static enum { ABORT, VERBATIM, WARN, WARN_STRIP, STRIP } signed_tag_mode = ABORT;
static enum { ERROR, DROP, REWRITE } tag_of_filtered_mode = ERROR;
static int fake_missing_tagger;
static int use_done_feature;
@@ -40,6 +40,8 @@ static int parse_opt_signed_tag_mode(const struct option *opt,
signed_tag_mode = VERBATIM;
else if (!strcmp(arg, "warn"))
signed_tag_mode = WARN;
+ else if (!strcmp(arg, "warn-strip"))
+ signed_tag_mode = WARN_STRIP;
else if (!strcmp(arg, "strip"))
signed_tag_mode = STRIP;
else
@@ -428,6 +430,10 @@ static void handle_tag(const char *name, struct tag *tag)
/* fallthru */
case VERBATIM:
break;
+ case WARN_STRIP:
+ warning ("Stripping signature from tag %s",
+ sha1_to_hex(tag->object.sha1));
+ /* fallthru */
case STRIP:
message_size = signature + 1 - message;
break;