From: Martin Langhoff <martin@catalyst.net.nz>
To: git@vger.kernel.org, junkio@cox.net
Cc: Martin Langhoff <martin@catalyst.net.nz>
Subject: [PATCH] git-clone: Error meaningfully on failed HTTP fetches of HEAD
Date: Thu, 12 Apr 2007 10:05:19 +1200 [thread overview]
Message-ID: <11763291192402-git-send-email-martin@catalyst.net.nz> (raw)
A common problem when cloning over http is that the repo has
a symlink for HEAD, and apache refuses to serve symlinks by
default.
Without this patch, the clone succeeds as a "bare" and "HEADless"
clone, but does not give any indication that things have gone
wrong.
A bare clone that fails to fetch HEAD will still complete
"successfully". I'm not sure if that's expected/desired. Is a
HEADless repo valid in any situation?
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
---
git-clone.sh | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index 513b574..ef8cd26 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -65,6 +65,11 @@ Perhaps git-update-server-info needs to be run there?"
rm -fr "$clone_tmp"
http_fetch "$1/HEAD" "$GIT_DIR/REMOTE_HEAD" ||
rm -f "$GIT_DIR/REMOTE_HEAD"
+
+ if test -z "$bare" && test ! -f "$GIT_DIR/REMOTE_HEAD"
+ then
+ die "Could not retrieve $1/HEAD - perhaps it is a symlink?"
+ fi
}
quiet=
--
1.5.1.106.ga32037
next reply other threads:[~2007-04-11 22:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-11 22:05 Martin Langhoff [this message]
2007-04-12 0:24 ` [PATCH] git-clone: Error meaningfully on failed HTTP fetches of HEAD Junio C Hamano
2007-04-12 0:28 ` Martin Langhoff
2007-04-12 0:38 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11763291192402-git-send-email-martin@catalyst.net.nz \
--to=martin@catalyst.net.nz \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).