From: Junio C Hamano Date: Tue, 22 May 2018 05:18:06 +0000 (+0900) Subject: Sync with Git 2.15.2 X-Git-Tag: v2.16.4~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/023020401d21c8c48d7f0a123c7ff50888e101c7 Sync with Git 2.15.2 * maint-2.15: Git 2.15.2 Git 2.14.4 Git 2.13.7 verify_path: disallow symlinks in .gitmodules update-index: stat updated files earlier verify_dotfile: mention case-insensitivity in comment verify_path: drop clever fallthrough skip_prefix: add case-insensitive variant is_{hfs,ntfs}_dotgitmodules: add tests is_ntfs_dotgit: match other .git files is_hfs_dotgit: match other .git files is_ntfs_dotgit: use a size_t for traversing string submodule-config: verify submodule names as paths --- 023020401d21c8c48d7f0a123c7ff50888e101c7 diff --cc cache.h index fd755c32cf,803bd7094a..4c29dd02e8 --- a/cache.h +++ b/cache.h @@@ -646,16 -608,7 +646,16 @@@ extern int write_locked_index(struct in 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 verify_path(const char *path, unsigned mode); 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); extern void adjust_dirname_case(struct index_state *istate, char *name);