Commit 0ca7ca3e by Carlos Martín Nieto

refspec: allow a simple branchname

A simple branchname as refspec is valid and we shouldn't throw an
error when encountering one.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
parent dc9e960f
...@@ -23,8 +23,13 @@ int git_refspec_parse(git_refspec *refspec, const char *str) ...@@ -23,8 +23,13 @@ int git_refspec_parse(git_refspec *refspec, const char *str)
} }
delim = strchr(str, ':'); delim = strchr(str, ':');
if (delim == NULL) if (delim == NULL) {
return git__throw(GIT_EOBJCORRUPTED, "Failed to parse refspec. No ':'"); refspec->src = git__strdup(str);
if (refspec->src == NULL)
return GIT_ENOMEM;
return GIT_SUCCESS;
}
refspec->src = git__strndup(str, delim - str); refspec->src = git__strndup(str, delim - str);
if (refspec->src == NULL) if (refspec->src == NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment