aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/write-tree.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-12 13:29:32 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-12 10:15:39 -0700
commit1dc4ec2102971ee5d19331a8ccf09939272bc6ca (patch)
tree3e99eab7d74de2d6bd07417fdedc74229fd9f76c /builtin/write-tree.c
parentenvironment: make `get_object_directory()` accept a repository (diff)
downloadgit-1dc4ec2102971ee5d19331a8ccf09939272bc6ca.tar.gz
git-1dc4ec2102971ee5d19331a8ccf09939272bc6ca.zip
environment: make `get_index_file()` accept a repository
The `get_index_file()` function retrieves the path to the index file of `the_repository`. Make it accept a `struct repository` such that it can work on arbitrary repositories and make it part of the repository subsystem. This reduces our reliance on `the_repository` and clarifies scope. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/write-tree.c')
-rw-r--r--builtin/write-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/write-tree.c b/builtin/write-tree.c
index 8c75b4609b..9bcc4470ce 100644
--- a/builtin/write-tree.c
+++ b/builtin/write-tree.c
@@ -6,7 +6,6 @@
#include "builtin.h"
#include "config.h"
-#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "tree.h"
@@ -44,7 +43,8 @@ int cmd_write_tree(int argc, const char **argv, const char *cmd_prefix)
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
- ret = write_index_as_tree(&oid, the_repository->index, get_index_file(),
+ ret = write_index_as_tree(&oid, the_repository->index,
+ repo_get_index_file(the_repository),
flags, tree_prefix);
switch (ret) {
case 0: