summaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-05-17 22:51:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-17 23:13:10 (GMT)
commit0437a2e365f3b9156097d029ca6f91cbb8bffd5e (patch)
treee588c71c154de32809a11eae3a59fbef3e0f3cdc /environment.c
parentd0e5dd0ed49a8e79dab8a027ab14ee29709b47c6 (diff)
downloadgit-0437a2e365f3b9156097d029ca6f91cbb8bffd5e.zip
git-0437a2e365f3b9156097d029ca6f91cbb8bffd5e.tar.gz
git-0437a2e365f3b9156097d029ca6f91cbb8bffd5e.tar.bz2
cache: convert get_graft_file to handle arbitrary repositories
This conversion was done without the #define trick used in the earlier series refactoring to have better repository access, because this function is easy to review, as all lines are converted and it has only one caller. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/environment.c b/environment.c
index 87d9e52..ab42346 100644
--- a/environment.c
+++ b/environment.c
@@ -316,11 +316,11 @@ char *get_index_file(void)
return the_repository->index_file;
}
-char *get_graft_file(void)
+char *get_graft_file(struct repository *r)
{
- if (!the_repository->graft_file)
+ if (!r->graft_file)
BUG("git environment hasn't been setup");
- return the_repository->graft_file;
+ return r->graft_file;
}
int set_git_dir(const char *path)