aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2017-12-21 11:19:06 -0800
committerJunio C Hamano <gitster@pobox.com>2017-12-22 12:20:29 -0800
commitb101793c431b858e49b909bb309a87145fb7348c (patch)
treea5f796c240fb006d4adb2ff7c63a636888c73b85 /cache.h
parenteab3f2850e7cc63a8087fbeae608a1b72ea70c7b (diff)
downloadgit-b101793c431b858e49b909bb309a87145fb7348c.tar.gz
git-b101793c431b858e49b909bb309a87145fb7348c.tar.xz
move index_has_changes() from builtin/am.c to merge.c for reuse
index_has_changes() is a function we want to reuse outside of just am, making it also available for merge-recursive and merge-ort. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 6440e2bf2..caf610d3b 100644
--- a/cache.h
+++ b/cache.h
@@ -608,6 +608,15 @@ extern int write_locked_index(struct index_state *, struct lock_file *lock, unsi
extern int discard_index(struct index_state *);
extern void move_index_extensions(struct index_state *dst, struct index_state *src);
extern int unmerged_index(const struct index_state *);
+
+/**
+ * Returns 1 if the index differs from HEAD, 0 otherwise. When on an unborn
+ * branch, returns 1 if there are entries in the index, 0 otherwise. If an
+ * strbuf is provided, the space-separated list of files that differ will be
+ * appended to it.
+ */
+extern int index_has_changes(struct strbuf *sb);
+
extern int verify_path(const char *path);
extern int strcmp_offset(const char *s1, const char *s2, size_t *first_change);
extern int index_dir_exists(struct index_state *istate, const char *name, int namelen);