Commit f44ffd20bad62e47d8f239070f4143fbfb01f914

Stefan Sperling 2019-02-04T10:59:59

rename tree-specific fileindex diff callbacks

diff --git a/lib/fileindex.c b/lib/fileindex.c
index 624ff8c..752d228 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -564,13 +564,13 @@ walk_fileindex(struct got_fileindex *fileindex, struct got_fileindex_entry *ie)
 static const struct got_error *
 diff_fileindex_tree(struct got_fileindex *, struct got_fileindex_entry **,
     struct got_tree_object *, const char *, struct got_repository *,
-    struct got_fileindex_diff_cb *, void *);
+    struct got_fileindex_diff_tree_cb *, void *);
 
 static const struct got_error *
 walk_tree(struct got_tree_entry **next, struct got_fileindex *fileindex,
     struct got_fileindex_entry **ie, struct got_tree_entry *te,
     const char *path, struct got_repository *repo,
-    struct got_fileindex_diff_cb *cb, void *cb_arg)
+    struct got_fileindex_diff_tree_cb *cb, void *cb_arg)
 {
 	const struct got_error *err = NULL;
 
@@ -623,7 +623,7 @@ static const struct got_error *
 diff_fileindex_tree(struct got_fileindex *fileindex,
     struct got_fileindex_entry **ie, struct got_tree_object *tree,
     const char *path, struct got_repository *repo,
-    struct got_fileindex_diff_cb *cb, void *cb_arg)
+    struct got_fileindex_diff_tree_cb *cb, void *cb_arg)
 {
 	const struct got_error *err = NULL;
 	struct got_tree_entry *te = NULL;
@@ -683,7 +683,7 @@ diff_fileindex_tree(struct got_fileindex *fileindex,
 const struct got_error *
 got_fileindex_diff_tree(struct got_fileindex *fileindex,
     struct got_tree_object *tree, struct got_repository *repo,
-    struct got_fileindex_diff_cb *cb, void *cb_arg)
+    struct got_fileindex_diff_tree_cb *cb, void *cb_arg)
 {
 	struct got_fileindex_entry *min;
 	min = RB_MIN(got_fileindex_tree, &fileindex->entries);
diff --git a/lib/got_lib_fileindex.h b/lib/got_lib_fileindex.h
index dda31f7..0336dd7 100644
--- a/lib/got_lib_fileindex.h
+++ b/lib/got_lib_fileindex.h
@@ -114,18 +114,18 @@ typedef const struct got_error *(*got_fileindex_cb)(void *,
 const struct got_error *got_fileindex_for_each_entry_safe(
     struct got_fileindex *, got_fileindex_cb cb, void *);
 
-typedef const struct got_error *(*got_fileindex_diff_old_new_cb)(void *,
+typedef const struct got_error *(*got_fileindex_diff_tree_old_new_cb)(void *,
     struct got_fileindex_entry *, struct got_tree_entry *, const char *);
-typedef const struct got_error *(*got_fileindex_diff_old_cb)(void *,
+typedef const struct got_error *(*got_fileindex_diff_tree_old_cb)(void *,
     struct got_fileindex_entry *, const char *);
-typedef const struct got_error *(*got_fileindex_diff_new_cb)(void *,
+typedef const struct got_error *(*got_fileindex_diff_tree_new_cb)(void *,
     struct got_tree_entry *, const char *);
-struct got_fileindex_diff_cb {
-	got_fileindex_diff_old_new_cb diff_old_new;
-	got_fileindex_diff_old_cb diff_old;
-	got_fileindex_diff_new_cb diff_new;
+struct got_fileindex_diff_tree_cb {
+	got_fileindex_diff_tree_old_new_cb diff_old_new;
+	got_fileindex_diff_tree_old_cb diff_old;
+	got_fileindex_diff_tree_new_cb diff_new;
 };
 
 const struct got_error *got_fileindex_diff_tree(struct got_fileindex *,
     struct got_tree_object *, struct got_repository *,
-    struct got_fileindex_diff_cb *, void *);
+    struct got_fileindex_diff_tree_cb *, void *);
diff --git a/lib/worktree.c b/lib/worktree.c
index 15110d5..62fe586 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -804,7 +804,7 @@ got_worktree_checkout_files(struct got_worktree *worktree,
 	char *fileindex_path = NULL, *new_fileindex_path = NULL;
 	struct got_fileindex *fileindex = NULL;
 	FILE *index = NULL, *new_index = NULL;
-	struct got_fileindex_diff_cb diff_cb;
+	struct got_fileindex_diff_tree_cb diff_cb;
 	struct diff_cb_arg arg;
 
 	err = lock_worktree(worktree, LOCK_EX);