提交 61f01a5b 编写于 作者: J Junio C Hamano

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: NJunio C Hamano <junkio@cox.net>
上级 51017101
......@@ -81,10 +81,14 @@ canon_refs_list_for_fetch () {
local=$(expr "$ref" : '[^:]*:\(.*\)')
case "$remote" in
'') remote=HEAD ;;
refs/heads/* | refs/tags/*) ;;
heads/* | tags/* ) remote="refs/$remote" ;;
*) remote="refs/heads/$remote" ;;
esac
case "$local" in
'') local= ;;
refs/heads/* | refs/tags/*) ;;
heads/* | tags/* ) local="refs/$local" ;;
*) local="refs/heads/$local" ;;
esac
echo "${force}${remote}:${local}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册