Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-09-21 18:57:32 +0300
committerJunio C Hamano <gitster@pobox.com>2018-09-21 19:48:11 +0300
commit35843b1123e2772c5db6d7db5abf279c3253ae57 (patch)
tree2ddded58ca61d8a808a407fceb5c55a043cbf135 /builtin/rerere.c
parent58bf2a4cc7a929d2fe0ff30eda86fcec54aef0f8 (diff)
rerere.c: remove implicit dependency on the_index
The reason rerere(), rerere_forget() and rerere_remaining() take a struct repository instead of struct index_state is not obvious from the patch: Deep in update_paths() and find_conflict(), hold_locked_index() and read_index() are called. These functions assumes the index path at $GIT_DIR/index which is not always true when you take an arbitrary index state. Taking a repository will allow us to point to the right index path later when we replace them with repo_ versions. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rerere.c')
-rw-r--r--builtin/rerere.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/rerere.c b/builtin/rerere.c
index 0bc40298c2..1ca271b711 100644
--- a/builtin/rerere.c
+++ b/builtin/rerere.c
@@ -70,7 +70,7 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
flags = RERERE_NOAUTOUPDATE;
if (argc < 1)
- return rerere(flags);
+ return repo_rerere(the_repository, flags);
if (!strcmp(argv[0], "forget")) {
struct pathspec pathspec;
@@ -78,7 +78,7 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
warning("'git rerere forget' without paths is deprecated");
parse_pathspec(&pathspec, 0, PATHSPEC_PREFER_CWD,
prefix, argv + 1);
- return rerere_forget(&pathspec);
+ return rerere_forget(the_repository, &pathspec);
}
if (!strcmp(argv[0], "clear")) {
@@ -91,7 +91,7 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
for (i = 0; i < merge_rr.nr; i++)
printf("%s\n", merge_rr.items[i].string);
} else if (!strcmp(argv[0], "remaining")) {
- rerere_remaining(&merge_rr);
+ rerere_remaining(the_repository, &merge_rr);
for (i = 0; i < merge_rr.nr; i++) {
if (merge_rr.items[i].util != RERERE_RESOLVED)
printf("%s\n", merge_rr.items[i].string);