threads / patch / 47393

patchsetup.c: fix comment about order of .git directory discovery

Subject: [PATCH] setup.c: fix comment about order of .git directory discovery

## tl;dr

2 messages between Dec 7, 2017 and Dec 8, 2017. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

SZEDER Gábor· Dec 7, 2017, 08:59 UTC · lore

Since gitfiles were introduced in b44ebb19e (Add platform-independent .git "symlink", 2008-02-20) the order of checks during .git directory discovery is: gitfile, gitdir, bare repo. However, that commit did only partially update the in-code comment describing this order, missing the last line which still puts gitdir before gitfile.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
 setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to setup.c +1 −1
diff --git a/setup.c b/setup.c
index 03f51e056..b168d25db 100644
--- a/setup.c
+++ b/setup.c
@@ -921,7 +921,7 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
 	 * - ../.git
 	 * - ../.git/
 	 * - ../ (bare)
-	 * - ../../.git/
+	 * - ../../.git
 	 *   etc.
 	 */
 	one_filesystem = !git_env_bool("GIT_DISCOVERY_ACROSS_FILESYSTEM", 0);
-- 
2.15.1.338.g53352fef7
Jeff King· Dec 8, 2017, 10:02 UTC · re: SZEDER Gábor · lore

Re: [PATCH] setup.c: fix comment about order of .git directory discovery

On Thu, Dec 07, 2017 at 09:59:49AM +0100, SZEDER Gábor wrote:
Show 5 quoted lines
> Since gitfiles were introduced in b44ebb19e (Add platform-independent
> .git "symlink", 2008-02-20) the order of checks during .git directory
> discovery is: gitfile, gitdir, bare repo.  However, that commit did
> only partially update the in-code comment describing this order,
> missing the last line which still puts gitdir before gitfile.

I was confused at first, because your patch only changes to ".git/" to ".git". So there is no ordering change, only a swapping out of one for the other. But that pushes done the ".git/" into the "etc." which is below.

So I think this makes sense.
Thanks.
-Peff

← back to recent threads