threads / patch / 6581

patchgit-fetch: Allow fetching the remote HEAD

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

## tl;dr

2 messages between Jan 30, 2007 and Jan 30, 2007. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Santi Béjar· Jan 30, 2007, 09:36 UTC · lore
... 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(-)
Show changes to git-parse-remote.sh +1 −1
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

← back to recent threads