]> git.ipfire.org Git - thirdparty/git.git/commitdiff
refs/files: remove `refs_check_dir` parameter
authorPatrick Steinhardt <ps@pks.im>
Mon, 12 Jan 2026 09:02:52 +0000 (10:02 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jan 2026 14:55:40 +0000 (06:55 -0800)
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>
refs/files-backend.c

index feba3ee58bcc9b7e822ab5d0d009345e3e7e5936..0a104c7bf6a8a5f1d9656828eaed0e14a65fcf8a 100644 (file)
@@ -3898,7 +3898,6 @@ static const files_fsck_refs_fn fsck_refs_fn[]= {
 
 static int files_fsck_refs_dir(struct ref_store *ref_store,
                               struct fsck_options *o,
-                              const char *refs_check_dir,
                               struct worktree *wt)
 {
        struct strbuf refname = STRBUF_INIT;
@@ -3907,7 +3906,7 @@ static int files_fsck_refs_dir(struct ref_store *ref_store,
        int iter_status;
        int ret = 0;
 
-       strbuf_addf(&sb, "%s/%s", ref_store->gitdir, refs_check_dir);
+       strbuf_addf(&sb, "%s/refs", ref_store->gitdir);
 
        iter = dir_iterator_begin(sb.buf, 0);
        if (!iter) {
@@ -3927,8 +3926,7 @@ static int files_fsck_refs_dir(struct ref_store *ref_store,
 
                        if (!is_main_worktree(wt))
                                strbuf_addf(&refname, "worktrees/%s/", wt->id);
-                       strbuf_addf(&refname, "%s/%s", refs_check_dir,
-                                   iter->relative_path);
+                       strbuf_addf(&refname, "refs/%s", iter->relative_path);
 
                        if (o->verbose)
                                fprintf_ln(stderr, "Checking %s", refname.buf);
@@ -3960,7 +3958,7 @@ static int files_fsck_refs(struct ref_store *ref_store,
                           struct fsck_options *o,
                           struct worktree *wt)
 {
-       return files_fsck_refs_dir(ref_store, o, "refs", wt);
+       return files_fsck_refs_dir(ref_store, o, wt);
 }
 
 static int files_fsck(struct ref_store *ref_store,