git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-clone: fetch possibly detached HEAD over dumb http
@ 2007-06-28 10:52 Sven Verdoolaege
  2007-06-29  0:02 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Sven Verdoolaege @ 2007-06-28 10:52 UTC (permalink / raw)
  To: Junio C Hamano, git; +Cc: Louis-Noel Pouchet

git-clone supports cloning from a repo with detached HEAD,
but if this HEAD is not behind any branch tip then it
would not have been fetched over dumb http, resulting in a

	fatal: Not a valid object name HEAD

Since 928c210a, this would also happen on a http repo
with a HEAD that is a symbolic link where someone has
forgotton to run update-server-info.

Signed-off-by: Sven Verdoolaege <skimo@liacs.nl>
---
 git-clone.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-clone.sh b/git-clone.sh
index bd44ce1..cdbbc20 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -70,7 +70,8 @@ Perhaps git-update-server-info needs to be run there?"
 		git-http-fetch $v -a -w "$tname" "$sha1" "$1" || exit 1
 	done <"$clone_tmp/refs"
 	rm -fr "$clone_tmp"
-	http_fetch "$1/HEAD" "$GIT_DIR/REMOTE_HEAD" ||
+	http_fetch "$1/HEAD" "$GIT_DIR/REMOTE_HEAD" &&
+	git-http-fetch $v -a $(cat "$GIT_DIR/REMOTE_HEAD") "$1" ||
 	rm -f "$GIT_DIR/REMOTE_HEAD"
 }
 
-- 
1.5.2.2.585.g9cc0-dirty

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-07-01 16:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-28 10:52 [PATCH] git-clone: fetch possibly detached HEAD over dumb http Sven Verdoolaege
2007-06-29  0:02 ` Junio C Hamano
2007-06-29  8:11   ` Sven Verdoolaege
2007-06-29  8:31   ` Sven Verdoolaege
2007-06-30 13:33     ` Alex Riesen
2007-06-30 13:45       ` Sven Verdoolaege
2007-06-30 22:23         ` Alex Riesen
2007-07-01  2:22           ` Junio C Hamano
2007-07-01 16:40             ` Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).