Skip to content

Commit f777f4d

Browse files
pks-tgitster
authored andcommitted
refs: stop using the_repository
Convert "refs.c" 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 39bf06a commit f777f4d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

refs.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* The backend-independent part of the reference module.
33
*/
44

5-
#define USE_THE_REPOSITORY_VARIABLE
6-
75
#include "git-compat-util.h"
86
#include "advice.h"
97
#include "config.h"
@@ -1838,7 +1836,7 @@ const char *refs_resolve_ref_unsafe(struct ref_store *refs,
18381836
failure_errno != ENOTDIR)
18391837
return NULL;
18401838

1841-
oidclr(oid, the_repository->hash_algo);
1839+
oidclr(oid, refs->repo->hash_algo);
18421840
if (*flags & REF_BAD_NAME)
18431841
*flags |= REF_ISBROKEN;
18441842
return refname;
@@ -1848,15 +1846,15 @@ const char *refs_resolve_ref_unsafe(struct ref_store *refs,
18481846

18491847
if (!(read_flags & REF_ISSYMREF)) {
18501848
if (*flags & REF_BAD_NAME) {
1851-
oidclr(oid, the_repository->hash_algo);
1849+
oidclr(oid, refs->repo->hash_algo);
18521850
*flags |= REF_ISBROKEN;
18531851
}
18541852
return refname;
18551853
}
18561854

18571855
refname = sb_refname.buf;
18581856
if (resolve_flags & RESOLVE_REF_NO_RECURSE) {
1859-
oidclr(oid, the_repository->hash_algo);
1857+
oidclr(oid, refs->repo->hash_algo);
18601858
return refname;
18611859
}
18621860
if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
@@ -2011,7 +2009,7 @@ struct ref_store *repo_get_submodule_ref_store(struct repository *repo,
20112009
free(subrepo);
20122010
goto done;
20132011
}
2014-
refs = ref_store_init(subrepo, the_repository->ref_storage_format,
2012+
refs = ref_store_init(subrepo, repo->ref_storage_format,
20152013
submodule_sb.buf,
20162014
REF_STORE_READ | REF_STORE_ODB);
20172015
register_ref_store_map(&repo->submodule_ref_stores, "submodule",
@@ -2045,7 +2043,7 @@ struct ref_store *get_worktree_ref_store(const struct worktree *wt)
20452043
common_path.buf, REF_STORE_ALL_CAPS);
20462044
strbuf_release(&common_path);
20472045
} else {
2048-
refs = ref_store_init(wt->repo, the_repository->ref_storage_format,
2046+
refs = ref_store_init(wt->repo, wt->repo->ref_storage_format,
20492047
wt->repo->commondir, REF_STORE_ALL_CAPS);
20502048
}
20512049

0 commit comments

Comments
 (0)