diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-07-30 07:22:56 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-07-30 13:41:23 -0700 |
| commit | a6ebc2c6d19f57bc714416faad450c7aca20b8b9 (patch) | |
| tree | f22ae0bcda36a898d962c459e163852cf39eafca /refs/files-backend.c | |
| parent | 080b068ffb72a41ea23d11a6a5781e587db7d860 (diff) | |
refs/files: stop using `the_repository`
Convert the files ref backend to stop using `the_repository` in favor of
the repo that gets passed in via `struct ref_store`.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs/files-backend.c')
| -rw-r--r-- | refs/files-backend.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index 3437c79699..c73f95ecf2 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1,5 +1,3 @@ -#define USE_THE_REPOSITORY_VARIABLE - #include "../git-compat-util.h" #include "../copy.h" #include "../environment.h" @@ -248,7 +246,7 @@ static void loose_fill_ref_dir_regular_file(struct files_ref_store *refs, if (!refs_resolve_ref_unsafe(&refs->base, refname, RESOLVE_REF_READING, &oid, &flag)) { - oidclr(&oid, the_repository->hash_algo); + oidclr(&oid, refs->base.repo->hash_algo); flag |= REF_ISBROKEN; } else if (is_null_oid(&oid)) { /* @@ -265,7 +263,7 @@ static void loose_fill_ref_dir_regular_file(struct files_ref_store *refs, if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) { if (!refname_is_safe(refname)) die("loose refname is dangerous: %s", refname); - oidclr(&oid, the_repository->hash_algo); + oidclr(&oid, refs->base.repo->hash_algo); flag |= REF_BAD_NAME | REF_ISBROKEN; } add_entry_to_dir(dir, create_ref_entry(refname, &oid, flag)); @@ -1154,7 +1152,7 @@ static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs, if (!refs_resolve_ref_unsafe(&refs->base, lock->ref_name, 0, &lock->old_oid, NULL)) - oidclr(&lock->old_oid, the_repository->hash_algo); + oidclr(&lock->old_oid, refs->base.repo->hash_algo); goto out; error_return: |
