refs/files: remove `refs_check_dir` parameter
The parameter `refs_check_dir` determines which directory we want to check references for. But as we always want to check the complete refs hierarchy, this parameter is always set to "refs". Drop the parameter and hardcode it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Jan 12, 2026 at 10:02 UTC
5a74903e62d7f4acdb2849103a2763b160a763b1
1 file changed
+3
-5
refs/files-backend.c
+3
-5
@@ -3898,7 +3898,6 @@ static const files_fsck_refs_fn fsck_refs_fn[]= {
3898
3899
static int files_fsck_refs_dir(struct ref_store *ref_store,
3900
struct fsck_options *o,
3901
- const char *refs_check_dir,
3901
struct worktree *wt)
3902
{
3903
struct strbuf refname = STRBUF_INIT;
@@ -3907,7 +3906,7 @@ static int files_fsck_refs_dir(struct ref_store *ref_store,
3906
int iter_status;
3907
int ret = 0;
3908
3910
- strbuf_addf(&sb, "%s/%s", ref_store->gitdir, refs_check_dir);
3909
+ strbuf_addf(&sb, "%s/refs", ref_store->gitdir);
3910
3911
iter = dir_iterator_begin(sb.buf, 0);
3912
if (!iter) {
@@ -3927,8 +3926,7 @@ static int files_fsck_refs_dir(struct ref_store *ref_store,
3926
3927
if (!is_main_worktree(wt))
3928
strbuf_addf(&refname, "worktrees/%s/", wt->id);
3930
- strbuf_addf(&refname, "%s/%s", refs_check_dir,
3931
- iter->relative_path);
3929
+ strbuf_addf(&refname, "refs/%s", iter->relative_path);
3930
3931
if (o->verbose)
3932
fprintf_ln(stderr, "Checking %s", refname.buf);
@@ -3960,7 +3958,7 @@ static int files_fsck_refs(struct ref_store *ref_store,
3958
struct fsck_options *o,
3959
struct worktree *wt)
3960
{
3963
- return files_fsck_refs_dir(ref_store, o, "refs", wt);
3961
+ return files_fsck_refs_dir(ref_store, o, wt);
3962
}
3963
3964
static int files_fsck(struct ref_store *ref_store,