mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 15:10:02 +00:00
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>
This commit is contained in:
parent
dc9e960f4b
commit
0ca7ca3ef7
@ -23,8 +23,13 @@ int git_refspec_parse(git_refspec *refspec, const char *str)
|
||||
}
|
||||
|
||||
delim = strchr(str, ':');
|
||||
if (delim == NULL)
|
||||
return git__throw(GIT_EOBJCORRUPTED, "Failed to parse refspec. No ':'");
|
||||
if (delim == NULL) {
|
||||
refspec->src = git__strdup(str);
|
||||
if (refspec->src == NULL)
|
||||
return GIT_ENOMEM;
|
||||
|
||||
return GIT_SUCCESS;
|
||||
}
|
||||
|
||||
refspec->src = git__strndup(str, delim - str);
|
||||
if (refspec->src == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user