Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
We do not like "HEAD" as a new branch name
[gitweb.git]
/
refs.c
diff --git
a/refs.c
b/refs.c
index d2aec73edcbe06cf63009ac7dd85fa53b6c995b9..b8fcb98dad976c529dcccbaf592f567931b9a360 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-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;
}
}