parse-remote: trivial fix to allow refs/{heads,tags}/ spelled easier.
Earlier we always prefixed refs/heads to the token given to "git fetch" (and "git pull") as refspec. This was a mistake. Allow them to be spelled like "master:refs/tags/paulus" to mean "I want to fetch the master there and store it as my local "paulus" tag. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
51017101c7
commit
61f01a5b77
@ -81,10 +81,14 @@ canon_refs_list_for_fetch () {
|
|||||||
local=$(expr "$ref" : '[^:]*:\(.*\)')
|
local=$(expr "$ref" : '[^:]*:\(.*\)')
|
||||||
case "$remote" in
|
case "$remote" in
|
||||||
'') remote=HEAD ;;
|
'') remote=HEAD ;;
|
||||||
|
refs/heads/* | refs/tags/*) ;;
|
||||||
|
heads/* | tags/* ) remote="refs/$remote" ;;
|
||||||
*) remote="refs/heads/$remote" ;;
|
*) remote="refs/heads/$remote" ;;
|
||||||
esac
|
esac
|
||||||
case "$local" in
|
case "$local" in
|
||||||
'') local= ;;
|
'') local= ;;
|
||||||
|
refs/heads/* | refs/tags/*) ;;
|
||||||
|
heads/* | tags/* ) local="refs/$local" ;;
|
||||||
*) local="refs/heads/$local" ;;
|
*) local="refs/heads/$local" ;;
|
||||||
esac
|
esac
|
||||||
echo "${force}${remote}:${local}"
|
echo "${force}${remote}:${local}"
|
||||||
|
Loading…
Reference in New Issue
Block a user