libgit2/tests/online
Patrick Steinhardt 85addddf4c refspec: do not set empty rhs for fetch refspecs
According to git-fetch(1), "[t]he colon can be omitted when <dst>
is empty." So according to git, the refspec "refs/heads/master"
is the same as the refspec "refs/heads/master:" when fetching
changes. When trying to fetch from a remote with a trailing
colon with libgit2, though, the fetch actually fails while it
works when the trailing colon is left out. So obviously, libgit2
does _not_ treat these two refspec formats the same for fetches.

The problem results from parsing refspecs, where the resulting
refspec has its destination set to an empty string in the case of
a trailing colon and to a `NULL` pointer in the case of no
trailing colon. When passing this to our DWIM machinery, the
empty string gets translated to "refs/heads/", which is simply
wrong.

Fix the problem by having the parsing machinery treat both cases
the same for fetch refspecs.
2016-10-01 17:40:41 +02:00
..
badssl.c Use general cl_git_fail because the error is generic 2016-04-11 15:58:56 -04:00
clone.c Add a test for custom header validation 2015-09-10 13:18:26 -04:00
fetch.c Tell the git_transport about the custom_headers 2015-09-08 14:02:33 -04:00
fetchhead.c refspec: do not set empty rhs for fetch refspecs 2016-10-01 17:40:41 +02:00
push_util.c push: put the git_oid inline in the test structure 2015-09-13 05:38:29 +02:00
push_util.h push: put the git_oid inline in the test structure 2015-09-13 05:38:29 +02:00
push.c Merge pull request #3411 from spraints/custom-push-headers 2015-09-30 09:17:18 +02:00
remotes.c clone: don't rely on auto-saving for single-branch 2015-05-17 15:45:37 +02:00