diff options
author | Elijah Newren <newren@gmail.com> | 2017-12-21 22:19:06 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-22 23:20:29 +0300 |
commit | b101793c431b858e49b909bb309a87145fb7348c (patch) | |
tree | a5f796c240fb006d4adb2ff7c63a636888c73b85 /cache.h | |
parent | eab3f2850e7cc63a8087fbeae608a1b72ea70c7b (diff) |
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.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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); |