summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-04-24 14:08:29 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-04-24 14:08:29 +0200
commitbdc82e1c00776229b19688abaf08d6701f2dc41f (patch)
tree0cb09f8ece8c243f1639440374dd20ed8f2e8cea /src
parent212b6205d70ff7c0f0f0b1eda6ac964c8d09d431 (diff)
downloadlibgit2-bdc82e1c00776229b19688abaf08d6701f2dc41f.tar.gz
fetchhead: deal with quotes in branch names
The current FETCH_HEAD parsing code assumes that a quote must end the branch name. Git however allows for quotes as part of a branch name, which causes us to consider the FETCH_HEAD file as invalid. Instead of searching for a single quote char, search for a quote char followed by SP, which is not a valid part of a ref name.
Diffstat (limited to 'src')
-rw-r--r--src/fetchhead.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fetchhead.c b/src/fetchhead.c
index 4435454ef..a95ea4ca4 100644
--- a/src/fetchhead.c
+++ b/src/fetchhead.c
@@ -210,7 +210,7 @@ static int fetchhead_ref_parse(
name = desc + 1;
if (name) {
- if ((desc = strchr(name, '\'')) == NULL ||
+ if ((desc = strstr(name, "' ")) == NULL ||
git__prefixcmp(desc, "' of ") != 0) {
giterr_set(GITERR_FETCHHEAD,
"Invalid description in FETCH_HEAD line %d", line_num);