[PATCH 1/2] path.c: fix field name in 'struct common_dir'
From: SZEDER Gábor <hidden>
Date: 2019-10-18 11:42:11
Subsystem:
the rest · Maintainer:
Linus Torvalds
An array of 'struct common_dir' instances is used to specify whether various paths in the '.git' directory are worktree-specific or belong to the main worktree. Confusingly, the path is recorded in the struct's 'dirname' field, even though it can be a regular file, e.g. 'gc.pid'. Rename this 'dirname' field to 'path' to avoid future confusion. Signed-off-by: SZEDER Gábor <redacted> --- path.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/path.c b/path.c
index e3da1f3c4e..eeb43e1d25 100644
--- a/path.c
+++ b/path.c@@ -103,7 +103,7 @@ struct common_dir { unsigned is_dir:1; /* Not common even though its parent is */ unsigned exclude:1; - const char *dirname; + const char *path; }; static struct common_dir common_list[] = {
@@ -320,8 +320,8 @@ static void init_common_trie(void) if (common_trie_done_setup) return; - for (p = common_list; p->dirname; p++) - add_to_trie(&common_trie, p->dirname, p); + for (p = common_list; p->path; p++) + add_to_trie(&common_trie, p->path, p); common_trie_done_setup = 1; }
@@ -365,8 +365,8 @@ void report_linked_checkout_garbage(void) return; strbuf_addf(&sb, "%s/", get_git_dir()); len = sb.len; - for (p = common_list; p->dirname; p++) { - const char *path = p->dirname; + for (p = common_list; p->path; p++) { + const char *path = p->path; if (p->ignore_garbage) continue; strbuf_setlen(&sb, len);
--
2.23.0.1084.gae250eaa40