101
/* Not considered garbage for report_linked_checkout_garbage */
102
unsigned ignore_garbage:1;
103
unsigned is_dir:1;
104
- /* Not common even though its parent is */
105
- unsigned exclude:1;
106
- const char *dirname;
104
+ /* Belongs to the common dir, though it may contain paths that don't */
105
+ unsigned is_common:1;
106
+ const char *path;
107
};
108
109
static struct common_dir common_list[] = {
110
- { 0, 1, 0, "branches" },
111
- { 0, 1, 0, "common" },
112
- { 0, 1, 0, "hooks" },
113
- { 0, 1, 0, "info" },
114
- { 0, 0, 1, "info/sparse-checkout" },
115
- { 1, 1, 0, "logs" },
116
- { 1, 0, 1, "logs/HEAD" },
117
- { 0, 1, 1, "logs/refs/bisect" },
118
- { 0, 1, 1, "logs/refs/rewritten" },
119
- { 0, 1, 1, "logs/refs/worktree" },
120
- { 0, 1, 0, "lost-found" },
121
- { 0, 1, 0, "objects" },
122
- { 0, 1, 0, "refs" },
123
- { 0, 1, 1, "refs/bisect" },
124
- { 0, 1, 1, "refs/rewritten" },
125
- { 0, 1, 1, "refs/worktree" },
126
- { 0, 1, 0, "remotes" },
127
- { 0, 1, 0, "worktrees" },
128
- { 0, 1, 0, "rr-cache" },
129
- { 0, 1, 0, "svn" },
130
- { 0, 0, 0, "config" },
131
- { 1, 0, 0, "gc.pid" },
132
- { 0, 0, 0, "packed-refs" },
133
- { 0, 0, 0, "shallow" },
110
+ { 0, 1, 1, "branches" },
111
+ { 0, 1, 1, "common" },
112
+ { 0, 1, 1, "hooks" },
113
+ { 0, 1, 1, "info" },
114
+ { 0, 0, 0, "info/sparse-checkout" },
115
+ { 1, 1, 1, "logs" },
116
+ { 1, 0, 0, "logs/HEAD" },
117
+ { 0, 1, 0, "logs/refs/bisect" },
118
+ { 0, 1, 0, "logs/refs/rewritten" },
119
+ { 0, 1, 0, "logs/refs/worktree" },
120
+ { 0, 1, 1, "lost-found" },
121
+ { 0, 1, 1, "objects" },
122
+ { 0, 1, 1, "refs" },
123
+ { 0, 1, 0, "refs/bisect" },
124
+ { 0, 1, 0, "refs/rewritten" },
125
+ { 0, 1, 0, "refs/worktree" },
126
+ { 0, 1, 1, "remotes" },
127
+ { 0, 1, 1, "worktrees" },
128
+ { 0, 1, 1, "rr-cache" },
129
+ { 0, 1, 1, "svn" },
130
+ { 0, 0, 1, "config" },
131
+ { 1, 0, 1, "gc.pid" },
132
+ { 0, 0, 1, "packed-refs" },
133
+ { 0, 0, 1, "shallow" },
134
{ 0, 0, 0, NULL }
135
};
136
331
if (common_trie_done_setup)
332
return;
333
334
- for (p = common_list; p->dirname; p++)
335
- add_to_trie(&common_trie, p->dirname, p);
334
+ for (p = common_list; p->path; p++)
335
+ add_to_trie(&common_trie, p->path, p);
336
337
common_trie_done_setup = 1;
338
}
349
return 0;
350
351
if (dir->is_dir && (unmatched[0] == 0 || unmatched[0] == '/'))
352
- return !dir->exclude;
352
+ return dir->is_common;
353
354
if (!dir->is_dir && unmatched[0] == 0)
355
- return !dir->exclude;
355
+ return dir->is_common;
356
357
return 0;
358
}
376
return;
377
strbuf_addf(&sb, "%s/", get_git_dir());
378
len = sb.len;
379
- for (p = common_list; p->dirname; p++) {
380
- const char *path = p->dirname;
379
+ for (p = common_list; p->path; p++) {
380
+ const char *path = p->path;
381
if (p->ignore_garbage)
382
continue;
383
strbuf_setlen(&sb, len);