projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
We do not like "HEAD" as a new branch name
[git.git]
/
refs.c
diff --git
a/refs.c
b/refs.c
index
d2aec73
..
b8fcb98
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;
}
}