|
26 | 26 | #include "path.h"
|
27 | 27 | #include "preload-index.h"
|
28 | 28 | #include "read-cache.h"
|
| 29 | +#include "repository.h" |
29 | 30 | #include "string-list.h"
|
30 | 31 | #include "rerere.h"
|
31 | 32 | #include "unpack-trees.h"
|
@@ -407,7 +408,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
|
407 | 408 |
|
408 | 409 | discard_index(the_repository->index);
|
409 | 410 | read_index_from(the_repository->index, get_lock_file_path(&index_lock),
|
410 |
| - get_git_dir()); |
| 411 | + repo_get_git_dir(the_repository)); |
411 | 412 | if (cache_tree_update(the_repository->index, WRITE_TREE_SILENT) == 0) {
|
412 | 413 | if (reopen_lock_file(&index_lock) < 0)
|
413 | 414 | die(_("unable to write index file"));
|
@@ -472,7 +473,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
|
472 | 473 | COMMIT_LOCK | SKIP_IF_UNCHANGED))
|
473 | 474 | die(_("unable to write new index file"));
|
474 | 475 | commit_style = COMMIT_AS_IS;
|
475 |
| - ret = get_index_file(); |
| 476 | + ret = repo_get_index_file(the_repository); |
476 | 477 | goto out;
|
477 | 478 | }
|
478 | 479 |
|
@@ -534,7 +535,7 @@ static const char *prepare_index(const char **argv, const char *prefix,
|
534 | 535 |
|
535 | 536 | discard_index(the_repository->index);
|
536 | 537 | ret = get_lock_file_path(&false_lock);
|
537 |
| - read_index_from(the_repository->index, ret, get_git_dir()); |
| 538 | + read_index_from(the_repository->index, ret, repo_get_git_dir(the_repository)); |
538 | 539 | out:
|
539 | 540 | string_list_clear(&partial, 0);
|
540 | 541 | clear_pathspec(&pathspec);
|
@@ -1072,7 +1073,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
|
1072 | 1073 | */
|
1073 | 1074 | discard_index(the_repository->index);
|
1074 | 1075 | }
|
1075 |
| - read_index_from(the_repository->index, index_file, get_git_dir()); |
| 1076 | + read_index_from(the_repository->index, index_file, repo_get_git_dir(the_repository)); |
1076 | 1077 |
|
1077 | 1078 | if (cache_tree_update(the_repository->index, 0)) {
|
1078 | 1079 | error(_("Error building trees"));
|
@@ -1873,8 +1874,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
|
1873 | 1874 |
|
1874 | 1875 | repo_rerere(the_repository, 0);
|
1875 | 1876 | run_auto_maintenance(quiet);
|
1876 |
| - run_commit_hook(use_editor, get_index_file(), NULL, "post-commit", |
1877 |
| - NULL); |
| 1877 | + run_commit_hook(use_editor, repo_get_index_file(the_repository), |
| 1878 | + NULL, "post-commit", NULL); |
1878 | 1879 | if (amend && !no_post_rewrite) {
|
1879 | 1880 | commit_post_rewrite(the_repository, current_head, &oid);
|
1880 | 1881 | }
|
|
0 commit comments