summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06d900c)
raw | patch | inline | side by side (parent: 06d900c)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Fri, 16 Dec 2005 01:40:25 +0000 (02:40 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 16 Dec 2005 01:56:32 +0000 (17:56 -0800) |
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: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
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: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
refs.c | patch | blob | history |
index d2aec73edcbe06cf63009ac7dd85fa53b6c995b9..b8fcb98dad976c529dcccbaf592f567931b9a360 100644 (file)
--- a/refs.c
+++ b/refs.c
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;
}
}