[1/2] path.c: fix field name in 'struct common_dir'
diff mbox series

Message ID 20191018114202.5452-2-szeder.dev@gmail.com
State New
Headers show
Series
  • path.c: minor common_list fixes
Related show

Commit Message

SZEDER Gábor Oct. 18, 2019, 11:42 a.m. UTC
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 <szeder.dev@gmail.com>
---
 path.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch
diff mbox series

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);