git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-clone: Make sure the master branch exists before running cat on it.

From
AJAlexandre Julliard <julliard@winehq.org>
Date
Jan 9, 2007, 20:26 UTC
Message-ID
<87bql80wvn.fsf@wine.dyndns.org>
Otherwise we get an error like this on stderr:
  cat: [...]/.git/refs/remotes/origin/master: No such file or directory
which makes it look like git-clone failed.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 git-clone.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index 3d388de..cf761b2 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -355,7 +355,7 @@ then
 	# The name under $remote_top the remote HEAD seems to point at.
 	head_points_at=$(
 		(
-			echo "master"
+			test -f "$GIT_DIR/$remote_top/master" && echo "master"
 			cd "$GIT_DIR/$remote_top" &&
 			find . -type f -print | sed -e 's/^\.\///'
 		) | (
-- 
1.4.4.4.g37ed

-- 
Alexandre Julliard
julliard@winehq.org
Message 1 of 1 in “git-clone: Make sure the master branch exists before running cat on it.”
  1. git-clone: Make sure the master branch exists before running cat on it.Alexandre Julliard, Jan 9, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.