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

Re: [RFC PATCH] Add support for figuring out where in the git archive we are

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 17, 2005, 02:50 UTC
Message-ID
<Pine.LNX.4.58.0508161946350.3553@g5.osdl.org>
In-Reply-To
<7vwtml490s.fsf@assigned-by-dhcp.cox.net>
On Tue, 16 Aug 2005, Junio C Hamano wrote:
> 
> Merged, pushed out, and tested.  Ouch.  Fails on t0000 test.

It's because the new git-diff-files expects there to be a valid readable .git/HEAD, and is unhappy since the test hasn't updated HEAD.

This trivial patch fixes it.
		Linus
----
Fix test failure due to overly strict .git directory tests

We may not actually have a valid HEAD at all times, so relax the validity tests for a .git subdirectory accordingly.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-----
diff --git a/setup.c b/setup.c
--- a/setup.c
+++ b/setup.c
@@ -81,10 +81,9 @@ const char *setup_git_directory(void)
 	offset = len = strlen(cwd);
 	for (;;) {
 		/*
-		 * We always want to see a .git/HEAD and a .git/refs/
-		 * subdirectory
+		 * We always want to see a .git/refs/ subdirectory
 		 */
-		if (!access(".git/HEAD", R_OK) && !access(".git/refs/", X_OK)) {
+		if (!access(".git/refs/", X_OK)) {
 			/*
 			 * Then we need either a GIT_OBJECT_DIRECTORY define
 			 * or a .git/objects/ directory
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 10 in “Add support for figuring out where in the git archive we are”
  1. Add support for figuring out where in the git archive we areLinus Torvalds, Aug 16, 2005
  2. Yasushi SHOJIAug 16, 2005
  3. Junio C HamanoAug 16, 2005
  4. Linus TorvaldsAug 17, 2005
  5. Junio C HamanoAug 17, 2005
  6. Linus TorvaldsAug 17, 2005
  7. Junio C HamanoAug 17, 2005
  8. Linus TorvaldsAug 17, 2005
  9. Junio C HamanoAug 17, 2005
  10. Daniel BarkalowAug 17, 2005

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.