提交 fbaf834d 编写于 作者: J Junio C Hamano

show-branch: fix commit naming breakage.

It was ignoring the generation number of the commit when naming 2nd
and later parents, showing "(linus^n)^2" for any <n> incorrectly as
"linus^2".
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 c9fc748f
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册