diff options
Diffstat (limited to 'fast-import.c')
-rw-r--r-- | fast-import.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fast-import.c b/fast-import.c index c2a814ec66..23f625f561 100644 --- a/fast-import.c +++ b/fast-import.c @@ -297,7 +297,7 @@ static int failure; static FILE *pack_edges; static unsigned int show_stats = 1; static int global_argc; -static const char **global_argv; +static char **global_argv; /* Memory pools */ static size_t mem_pool_alloc = 2*1024*1024 - sizeof(struct mem_pool); @@ -1822,7 +1822,7 @@ static void read_marks(void) *end = 0; mark = strtoumax(line + 1, &end, 10); if (!mark || end == line + 1 - || *end != ' ' || get_sha1(end + 1, sha1)) + || *end != ' ' || get_sha1_hex(end + 1, sha1)) die("corrupt mark line: %s", line); e = find_object(sha1); if (!e) { @@ -2265,7 +2265,7 @@ static void file_change_m(struct branch *b) const char *p = command_buf.buf + 2; static struct strbuf uq = STRBUF_INIT; const char *endp; - struct object_entry *oe = oe; + struct object_entry *oe; unsigned char sha1[20]; uint16_t mode, inline_data = 0; @@ -2292,6 +2292,7 @@ static void file_change_m(struct branch *b) hashcpy(sha1, oe->idx.sha1); } else if (!prefixcmp(p, "inline ")) { inline_data = 1; + oe = NULL; /* not used with inline_data, but makes gcc happy */ p += strlen("inline"); /* advance to space */ } else { if (get_sha1_hex(p, sha1)) @@ -2434,7 +2435,7 @@ static void note_change_n(struct branch *b, unsigned char *old_fanout) { const char *p = command_buf.buf + 2; static struct strbuf uq = STRBUF_INIT; - struct object_entry *oe = oe; + struct object_entry *oe; struct branch *s; unsigned char sha1[20], commit_sha1[20]; char path[60]; @@ -2464,6 +2465,7 @@ static void note_change_n(struct branch *b, unsigned char *old_fanout) hashcpy(sha1, oe->idx.sha1); } else if (!prefixcmp(p, "inline ")) { inline_data = 1; + oe = NULL; /* not used with inline_data, but makes gcc happy */ p += strlen("inline"); /* advance to space */ } else { if (get_sha1_hex(p, sha1)) @@ -2613,7 +2615,7 @@ static int parse_from(struct branch *b) static struct hash_list *parse_merge(unsigned int *count) { - struct hash_list *list = NULL, *n, *e = e; + struct hash_list *list = NULL, **tail = &list, *n; const char *from; struct branch *s; @@ -2641,11 +2643,9 @@ static struct hash_list *parse_merge(unsigned int *count) die("Invalid ref name or SHA1 expression: %s", from); n->next = NULL; - if (list) - e->next = n; - else - list = n; - e = n; + *tail = n; + tail = &n->next; + (*count)++; read_next_command(); } @@ -3347,7 +3347,7 @@ static void parse_argv(void) read_marks(); } -int main(int argc, const char **argv) +int main(int argc, char **argv) { unsigned int i; |