@matheusbsbs / matheus-bagliano / commits / f2e6f1c976
Fork 0

name-rev: fix parent counting.

Noticed by linux@horizon.com. The first merge parent (typically "our branch") is ^1, not ^0, and the first other branch is ^2. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Nov 28, 2005 at 20:51 UTC f2e6f1c9763f65918211ed28caf77a40effa4e7e
1 file changed +2 -2
name-rev.c
+2 -2
@@ -21,7 +21,7 @@ static void name_rev(struct commit *commit,
21 {
22 struct rev_name *name = (struct rev_name *)commit->object.util;
23 struct commit_list *parents;
24 - int parent_number = 0;
24 + int parent_number = 1;
25
26 if (!commit->object.parsed)
27 parse_commit(commit);
@@ -56,7 +56,7 @@ copy_data:
56 for (parents = commit->parents;
57 parents;
58 parents = parents->next, parent_number++) {
59 - if (parent_number > 0) {
59 + if (parent_number > 1) {
60 char *new_name = xmalloc(strlen(tip_name)+8);
61
62 if (generation > 0)