Skip to content

Commit a6ebc2c

Browse files
pks-tgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 080b068 commit a6ebc2c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

refs/files-backend.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#define USE_THE_REPOSITORY_VARIABLE
2-
31
#include "../git-compat-util.h"
42
#include "../copy.h"
53
#include "../environment.h"
@@ -248,7 +246,7 @@ static void loose_fill_ref_dir_regular_file(struct files_ref_store *refs,
248246

249247
if (!refs_resolve_ref_unsafe(&refs->base, refname, RESOLVE_REF_READING,
250248
&oid, &flag)) {
251-
oidclr(&oid, the_repository->hash_algo);
249+
oidclr(&oid, refs->base.repo->hash_algo);
252250
flag |= REF_ISBROKEN;
253251
} else if (is_null_oid(&oid)) {
254252
/*
@@ -265,7 +263,7 @@ static void loose_fill_ref_dir_regular_file(struct files_ref_store *refs,
265263
if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
266264
if (!refname_is_safe(refname))
267265
die("loose refname is dangerous: %s", refname);
268-
oidclr(&oid, the_repository->hash_algo);
266+
oidclr(&oid, refs->base.repo->hash_algo);
269267
flag |= REF_BAD_NAME | REF_ISBROKEN;
270268
}
271269
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,
11541152

11551153
if (!refs_resolve_ref_unsafe(&refs->base, lock->ref_name, 0,
11561154
&lock->old_oid, NULL))
1157-
oidclr(&lock->old_oid, the_repository->hash_algo);
1155+
oidclr(&lock->old_oid, refs->base.repo->hash_algo);
11581156
goto out;
11591157

11601158
error_return:

0 commit comments

Comments
 (0)