# [PATCH] git-fetch: Allow fetching the remote HEAD

2 messages from 2007-01-30 to 2007-01-30. Participants: Santi Béjar, Junio C Hamano.
Thread: https://gitlist.dev/t/6581

## Santi Béjar, 2007-01-30 09:36

Subject: [PATCH] git-fetch: Allow fetching the remote HEAD
Message-ID: <87fy9sluuf.fsf@gmail.com>
URL: https://gitlist.dev/e/87fy9sluuf.fsf%40gmail.com

```

... 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>
---
 git-parse-remote.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 9d26967..3e783b7 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -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" ;;
-- 
1.5.0.rc2.224.gb3a6

```

## Junio C Hamano, 2007-01-30 10:27

Subject: Re: [PATCH] git-fetch: Allow fetching the remote HEAD
Message-ID: <7vk5z424jo.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vk5z424jo.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <87fy9sluuf.fsf@gmail.com>

```
Thanks.

```
