diff options
author | Elijah Newren <newren@gmail.com> | 2017-12-21 20:19:06 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-22 21:20:29 +0100 |
commit | b101793c431b858e49b909bb309a87145fb7348c (patch) | |
tree | a5f796c240fb006d4adb2ff7c63a636888c73b85 /cache.h | |
parent | t6044: recursive can silently incorporate dirty changes in a merge (diff) | |
download | git-b101793c431b858e49b909bb309a87145fb7348c.tar.xz git-b101793c431b858e49b909bb309a87145fb7348c.zip |
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); |