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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:04

Linus Torvalds [off-list ref] writes:
Mostly done. It actually works from inside subdirectories, but "." at the
top-level is still not done. Small detail. Will fix later. But it would
help if you would apply this, since I'm going to be off for dinner..
Merged, pushed out, and tested.  Ouch.  Fails on t0000 test.

Next time I'll do merge, test, reject and push out, in that
order.

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

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:04


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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help