summaryrefslogtreecommitdiff
path: root/rerere.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-09-21 15:57:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-21 16:48:11 (GMT)
commit35843b1123e2772c5db6d7db5abf279c3253ae57 (patch)
tree2ddded58ca61d8a808a407fceb5c55a043cbf135 /rerere.h
parent58bf2a4cc7a929d2fe0ff30eda86fcec54aef0f8 (diff)
downloadgit-35843b1123e2772c5db6d7db5abf279c3253ae57.zip
git-35843b1123e2772c5db6d7db5abf279c3253ae57.tar.gz
git-35843b1123e2772c5db6d7db5abf279c3253ae57.tar.bz2
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 'rerere.h')
-rw-r--r--rerere.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/rerere.h b/rerere.h
index cd948f2..5ad8864 100644
--- a/rerere.h
+++ b/rerere.h
@@ -4,6 +4,7 @@
#include "string-list.h"
struct pathspec;
+struct repository;
#define RERERE_AUTOUPDATE 01
#define RERERE_NOAUTOUPDATE 02
@@ -23,7 +24,10 @@ struct rerere_id {
};
int setup_rerere(struct string_list *, int);
-int rerere(int);
+#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
+#define rerere(flags) repo_rerere(the_repository, flags)
+#endif
+int repo_rerere(struct repository *, int);
/*
* Given the conflict ID and the name of a "file" used for replaying
* the recorded resolution (e.g. "preimage", "postimage"), return the
@@ -31,8 +35,8 @@ int rerere(int);
* return the path to the directory that houses these files.
*/
const char *rerere_path(const struct rerere_id *, const char *file);
-int rerere_forget(struct pathspec *);
-int rerere_remaining(struct string_list *);
+int rerere_forget(struct repository *, struct pathspec *);
+int rerere_remaining(struct repository *, struct string_list *);
void rerere_clear(struct string_list *);
void rerere_gc(struct string_list *);