提交 ee34518d 编写于 作者: J Johannes Schindelin 提交者: Junio C Hamano

We do not like "HEAD" as a new branch name

This makes git-check-ref-format fail for "HEAD". Since the check is only
executed when creating refs, the existing symbolic ref is safe.

Otherwise these commands, most likely are pilot errors, would do
pretty funky stuff:

	git checkout -b HEAD
	git pull . other:HEAD
Signed-off-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 06d900cf
......@@ -345,6 +345,11 @@ int check_ref_format(const char *ref)
if (!ch) {
if (level < 2)
return -1; /* at least of form "heads/blah" */
/* do not allow ref name to end in "HEAD" */
if (cp - ref > 4 && !strcmp(cp - 4, "HEAD"))
return -1;
return 0;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册