Skip to content

Commit 750036c

Browse files
avargitster
authored andcommitted
refs/ref-cache.[ch]: remove "incomplete" from create_dir_entry()
Remove the now-unused "incomplete" parameter from create_dir_entry(), all its callers specify it as "1", so let's drop the "incomplete=0" case. The last caller to use it was search_for_subdir(), but that code was removed in the preceding commit. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5e4546d commit 750036c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

refs/files-backend.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static void add_per_worktree_entries_to_dir(struct ref_dir *dir, const char *dir
227227
pos = search_ref_dir(dir, prefix, prefix_len);
228228
if (pos >= 0)
229229
continue;
230-
child_entry = create_dir_entry(dir->cache, prefix, prefix_len, 1);
230+
child_entry = create_dir_entry(dir->cache, prefix, prefix_len);
231231
add_entry_to_dir(dir, child_entry);
232232
}
233233
}
@@ -278,7 +278,7 @@ static void loose_fill_ref_dir(struct ref_store *ref_store,
278278
strbuf_addch(&refname, '/');
279279
add_entry_to_dir(dir,
280280
create_dir_entry(dir->cache, refname.buf,
281-
refname.len, 1));
281+
refname.len));
282282
} else {
283283
if (!refs_resolve_ref_unsafe(&refs->base,
284284
refname.buf,
@@ -336,7 +336,7 @@ static struct ref_cache *get_loose_ref_cache(struct files_ref_store *refs)
336336
* lazily):
337337
*/
338338
add_entry_to_dir(get_ref_dir(refs->loose->root),
339-
create_dir_entry(refs->loose, "refs/", 5, 1));
339+
create_dir_entry(refs->loose, "refs/", 5));
340340
}
341341
return refs->loose;
342342
}

refs/ref-cache.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct ref_cache *create_ref_cache(struct ref_store *refs,
4949

5050
ret->ref_store = refs;
5151
ret->fill_ref_dir = fill_ref_dir;
52-
ret->root = create_dir_entry(ret, "", 0, 1);
52+
ret->root = create_dir_entry(ret, "", 0);
5353
return ret;
5454
}
5555

@@ -86,14 +86,13 @@ static void clear_ref_dir(struct ref_dir *dir)
8686
}
8787

8888
struct ref_entry *create_dir_entry(struct ref_cache *cache,
89-
const char *dirname, size_t len,
90-
int incomplete)
89+
const char *dirname, size_t len)
9190
{
9291
struct ref_entry *direntry;
9392

9493
FLEX_ALLOC_MEM(direntry, name, dirname, len);
9594
direntry->u.subdir.cache = cache;
96-
direntry->flag = REF_DIR | (incomplete ? REF_INCOMPLETE : 0);
95+
direntry->flag = REF_DIR | REF_INCOMPLETE;
9796
return direntry;
9897
}
9998

refs/ref-cache.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ struct ref_dir *get_ref_dir(struct ref_entry *entry);
169169
* "refs/heads/") or "" for the top-level directory.
170170
*/
171171
struct ref_entry *create_dir_entry(struct ref_cache *cache,
172-
const char *dirname, size_t len,
173-
int incomplete);
172+
const char *dirname, size_t len);
174173

175174
struct ref_entry *create_ref_entry(const char *refname,
176175
const struct object_id *oid, int flag);

0 commit comments

Comments
 (0)