diff options
Diffstat (limited to 'show-branch.c')
-rw-r--r-- | show-branch.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/show-branch.c b/show-branch.c index 8cc0755e0a..5778a594f4 100644 --- a/show-branch.c +++ b/show-branch.c @@ -138,7 +138,20 @@ static void name_commits(struct commit_list *list, nth++; if (p->object.util) continue; - sprintf(newname, "%s^%d", n->head_name, nth); + switch (n->generation) { + case 0: + sprintf(newname, "%s^%d", + n->head_name, nth); + break; + case 1: + sprintf(newname, "%s^^%d", + n->head_name, nth); + break; + default: + sprintf(newname, "%s~%d^%d", + n->head_name, n->generation, + nth); + } name_commit(p, strdup(newname), 0); i++; name_first_parent_chain(p); |