summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2016-09-06 11:21:29 +0200
committerGitHub <noreply@github.com>2016-09-06 11:21:29 +0200
commit46035d984fc025d9acc0be2ffdeea21966b06aed (patch)
tree7d3b782c2ca07799d9f4cf9b41021e82b3950e69 /src
parentce54e77c70b5d0429a7d8a18dd31696f668ef3d0 (diff)
parent1eee631d1189312219773e699d76848680c02e19 (diff)
downloadlibgit2-46035d984fc025d9acc0be2ffdeea21966b06aed.tar.gz
Merge pull request #3882 from pks-t/pks/fix-fetch-refspec-dst-parsing
refspec: do not set empty rhs for fetch refspecs
Diffstat (limited to 'src')
-rw-r--r--src/refspec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/refspec.c b/src/refspec.c
index debde8692..d200e5609 100644
--- a/src/refspec.c
+++ b/src/refspec.c
@@ -53,8 +53,10 @@ int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
if (rhs) {
size_t rlen = strlen(++rhs);
- is_glob = (1 <= rlen && strchr(rhs, '*'));
- refspec->dst = git__strndup(rhs, rlen);
+ if (rlen || !is_fetch) {
+ is_glob = (1 <= rlen && strchr(rhs, '*'));
+ refspec->dst = git__strndup(rhs, rlen);
+ }
}
llen = (rhs ? (size_t)(rhs - lhs - 1) : strlen(lhs));