summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-30 08:08:24 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-30 08:08:24 (GMT)
commit61f01a5b773915402da37a34e706db56fe90b776 (patch)
treece9b5a4124cd4829c6113131e0bad449d682432a
parent51017101c7a308745ba3c04944457f1dc6a55780 (diff)
downloadgit-61f01a5b773915402da37a34e706db56fe90b776.zip
git-61f01a5b773915402da37a34e706db56fe90b776.tar.gz
git-61f01a5b773915402da37a34e706db56fe90b776.tar.bz2
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>
-rwxr-xr-xgit-parse-remote-script4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-parse-remote-script b/git-parse-remote-script
index cf37884..43b4368 100755
--- a/git-parse-remote-script
+++ b/git-parse-remote-script
@@ -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}"