Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15

Re: [PATCH] refs.c: get_ref_cache: use a bucket hash

From: Andreas Krey <hidden>
Date: 2016-06-15 23:07:15
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

On Fri, 13 Nov 2015 19:01:18 +0000, Jeff King wrote:
...
  2. But for a little more work, pushing the is_git_directory() check
     out to the call-sites gives us probably saner semantics overall.
Oops, now I get it[1]: You mean replacing resolve_gitlink_ref usages
with is_git_directory, like:
diff --git a/dir.c b/dir.c
index d2a8f06..7765dc6 100644
--- a/dir.c
+++ b/dir.c
@@ -1375,8 +1375,7 @@ static enum path_treatment treat_directory(struct dir_struct *dir,
 		if (dir->flags & DIR_SHOW_OTHER_DIRECTORIES)
 			break;
 		if (!(dir->flags & DIR_NO_GITLINKS)) {
-			unsigned char sha1[20];
-			if (resolve_gitlink_ref(dirname, "HEAD", sha1) == 0)
+			if (is_git_directory(dirname))
 				return path_untracked;
 		}
 		return path_recurse;
That, I like. If it is correct.

Andreas

[1] After reading the introduction of is_git_directory, 0179ca7a62.

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help