diff --git a/fast-import.c b/fast-import.c index c2a814ec66..583a439dba 100644 --- a/fast-import.c +++ b/fast-import.c @@ -2613,7 +2613,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 +2641,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(); }