Code

git-fetch: Allow fetching the remote HEAD
authorSanti Béjar <sbejar@gmail.com>
Tue, 30 Jan 2007 09:36:24 +0000 (10:36 +0100)
committerJunio C Hamano <junkio@cox.net>
Tue, 30 Jan 2007 10:30:25 +0000 (02:30 -0800)
... with:

$ git fetch ${remote} HEAD

Also

$ git fetch ${remote} :${localref}

worked, but

$ git fetch ${remote} HEAD:{localref}

didn't. Now both are equivalent.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-parse-remote.sh

index 9d269671de65d970446a31cd0d8962a5e05332b3..3e783b7b056de113584e526835a23fb05dfdcfce 100755 (executable)
@@ -183,7 +183,7 @@ canon_refs_list_for_fetch () {
                        done
                fi
                case "$remote" in
-               '') remote=HEAD ;;
+               '' | HEAD ) remote=HEAD ;;
                refs/heads/* | refs/tags/* | refs/remotes/*) ;;
                heads/* | tags/* | remotes/* ) remote="refs/$remote" ;;
                *) remote="refs/heads/$remote" ;;