summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2018-07-01 01:24:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-03 20:13:18 (GMT)
commit1b9fbefbe08ff2bbcbb8a6089867b32fca603eac (patch)
tree34cb866304417116c47b1ec2a34b8421d331323f /cache.h
parentcffbfad50d1f37aea03520dd8d8ea983bc57da02 (diff)
downloadgit-1b9fbefbe08ff2bbcbb8a6089867b32fca603eac.zip
git-1b9fbefbe08ff2bbcbb8a6089867b32fca603eac.tar.gz
git-1b9fbefbe08ff2bbcbb8a6089867b32fca603eac.tar.bz2
index_has_changes(): avoid assuming operating on the_index
Modify index_has_changes() to take a struct istate* instead of just operating on the_index. This is only a partial conversion, though, because we call do_diff_cache() which implicitly assumes work is to be done on the_index. Ongoing work is being done elsewhere to do the remainder of the conversion, and thus is not duplicated here. Instead, a simple check is put in place until that work is complete. 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.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/cache.h b/cache.h
index 0323853..169c809 100644
--- a/cache.h
+++ b/cache.h
@@ -627,12 +627,13 @@ extern void move_index_extensions(struct index_state *dst, struct index_state *s
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.
+ * Returns 1 if istate differs from HEAD, 0 otherwise. When on an unborn
+ * branch, returns 1 if there are entries in istate, 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 index_has_changes(const struct index_state *istate,
+ struct strbuf *sb);
extern int verify_path(const char *path, unsigned mode);
extern int strcmp_offset(const char *s1, const char *s2, size_t *first_change);