Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
fast-import: use pointer-to-pointer to keep list tail
author
Jeff King
<peff@peff.net>
Thu, 21 Mar 2013 11:08:17 +0000
(07:08 -0400)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 21 Mar 2013 21:06:19 +0000
(14:06 -0700)
This is shorter, idiomatic, and it means the compiler does
not get confused about whether our "e" pointer is valid,
letting us drop the "e = e" hack.
Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fast-import.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
1c71541
)
diff --git
a/fast-import.c
b/fast-import.c
index c2a814ec660862937e495c0a7efb6375dc7718ac..583a439dbac4191c8792a29825a13eb28a07031e 100644
(file)
--- 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();
}