]> git.proxmox.com Git - libgit2.git/commit
clone: handle overly restrictive refspecs
authorCarlos Martín Nieto <cmn@dwim.me>
Tue, 2 Sep 2014 11:23:54 +0000 (13:23 +0200)
committerCarlos Martín Nieto <cmn@dwim.me>
Tue, 2 Sep 2014 11:23:54 +0000 (13:23 +0200)
commit15c30b72e16528bdf71c0343e4d238600c0df7a1
treea27d9413a7bc5e8dc94880a6020c95e3e1f6b4e6
parente128a1af6ec552f880051b67d72ab0a4c4c7d074
clone: handle overly restrictive refspecs

When the fetch refspec does not include the remote's default branch, it
indicates an error in user expectations or programmer error. Error out
in that case.

This lets us get rid of the dummy refspec which can never work as its
zeroed out. In the cases where we did not find a default branch, we set
HEAD detached immediately, which lets us refactor the "normal" path,
removing `found_branch`.
src/clone.c
tests/network/remote/remotes.c