summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-12-19 19:32:29 -0800
committerJunio C Hamano <gitster@pobox.com>2008-12-19 19:35:55 -0800
commitefe05b019ca19328d27c07ef32b4698a7f36166f (patch)
treea38d3c5713d39370e881c148ff0f5c9d4db59c67 /fast-import.c
parentec9f0ea3e6ecf1237223dec8428e7bb73d339320 (diff)
parent718258e256b74622aa55f5ee0cb9cff4cce6bf9f (diff)
downloadgit-efe05b019ca19328d27c07ef32b4698a7f36166f.tar.gz
Merge branch 'maint' to sync with GIT 1.6.0.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/fast-import.c b/fast-import.c
index 201d4ffa13..171d178339 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -43,7 +43,7 @@ Format of STDIN stream:
new_tag ::= 'tag' sp tag_str lf
'from' sp (ref_str | hexsha1 | sha1exp_str | idnum) lf
- 'tagger' sp name '<' email '>' when lf
+ ('tagger' sp name '<' email '>' when lf)?
tag_msg;
tag_msg ::= data;
@@ -2265,23 +2265,27 @@ static void parse_new_tag(void)
read_next_command();
/* tagger ... */
- if (prefixcmp(command_buf.buf, "tagger "))
- die("Expected tagger command, got %s", command_buf.buf);
- tagger = parse_ident(command_buf.buf + 7);
+ if (!prefixcmp(command_buf.buf, "tagger ")) {
+ tagger = parse_ident(command_buf.buf + 7);
+ read_next_command();
+ } else
+ tagger = NULL;
/* tag payload/message */
- read_next_command();
parse_data(&msg);
/* build the tag object */
strbuf_reset(&new_data);
+
strbuf_addf(&new_data,
- "object %s\n"
- "type %s\n"
- "tag %s\n"
- "tagger %s\n"
- "\n",
- sha1_to_hex(sha1), commit_type, t->name, tagger);
+ "object %s\n"
+ "type %s\n"
+ "tag %s\n",
+ sha1_to_hex(sha1), commit_type, t->name);
+ if (tagger)
+ strbuf_addf(&new_data,
+ "tagger %s\n", tagger);
+ strbuf_addch(&new_data, '\n');
strbuf_addbuf(&new_data, &msg);
free(tagger);