Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jc/no-branch-name-with-dash-at-front'
author
Junio C Hamano
<gitster@pobox.com>
Wed, 29 Sep 2010 20:49:38 +0000
(13:49 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 29 Sep 2010 20:49:38 +0000
(13:49 -0700)
* jc/no-branch-name-with-dash-at-front:
disallow branch names that start with a hyphen
strbuf.c
patch
|
blob
|
history
raw
(from parent 1:
0ff4bdb
)
diff --git
a/strbuf.c
b/strbuf.c
index bc3a0802ea7e7b1743602972de182391b4bf0b3f..65b4cf43434a8b7327565d0e0f87d5378d098f99 100644
(file)
--- a/
strbuf.c
+++ b/
strbuf.c
@@
-399,6
+399,8
@@
int strbuf_branchname(struct strbuf *sb, const char *name)
int strbuf_check_branch_ref(struct strbuf *sb, const char *name)
{
strbuf_branchname(sb, name);
+ if (name[0] == '-')
+ return CHECK_REF_FORMAT_ERROR;
strbuf_splice(sb, 0, 0, "refs/heads/", 11);
return check_ref_format(sb->buf);
}