diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-12-22 20:48:38 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-22 20:48:38 (GMT) |
commit | b6825b5c8e8b58943511f2576475accf1593486e (patch) | |
tree | de8bc8a4fdf954c8870cb1a1d60f3d38b781d12f /cache.h | |
parent | 936d1b989416a95f593bf81ccae8ac62cd83f279 (diff) | |
parent | 65170c07d466b18364e0d2b6a360900c073b600f (diff) | |
download | git-b6825b5c8e8b58943511f2576475accf1593486e.zip git-b6825b5c8e8b58943511f2576475accf1593486e.tar.gz git-b6825b5c8e8b58943511f2576475accf1593486e.tar.bz2 |
Merge branch 'ew/empty-merge-with-dirty-index-maint' into ew/empty-merge-with-dirty-index
* ew/empty-merge-with-dirty-index-maint:
merge-recursive: avoid incorporating uncommitted changes in a merge
move index_has_changes() from builtin/am.c to merge.c for reuse
t6044: recursive can silently incorporate dirty changes in a merge
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -644,6 +644,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); |