summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-09-21 15:57:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-21 16:48:10 (GMT)
commit92a1bf5a58920e5f1f51106f06cd9dc6d6eb6c43 (patch)
tree7e4fbf1772d3e75f2c38aae41b3a3226b430821b /read-cache.c
parentce3a7ec8bd2faf49f4162356305237409a9b4c7b (diff)
downloadgit-92a1bf5a58920e5f1f51106f06cd9dc6d6eb6c43.zip
git-92a1bf5a58920e5f1f51106f06cd9dc6d6eb6c43.tar.gz
git-92a1bf5a58920e5f1f51106f06cd9dc6d6eb6c43.tar.bz2
read-cache.c: remove 'const' from index_has_changes()
This function calls do_diff_cache() which eventually needs to set this "istate" to unpack_options->src_index [1]. This is an unfortunate fact that unpack_trees() _will_ update [2] src_index so we can't really pass a const index_state there. Just remove 'const'. [1] Right now diff_cache() in diff-lib.c assigns the_index to src_index. But the plan is to get rid of the_index, so it should be 'istate' from here that gets assigned to src_index. [2] Some transient bits in the source index are touched. Optional extensions can also be removed. But other than that the source tree should still be valid. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 7b1354d..86134e5 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2122,7 +2122,7 @@ int unmerged_index(const struct index_state *istate)
return 0;
}
-int index_has_changes(const struct index_state *istate,
+int index_has_changes(struct index_state *istate,
struct tree *tree,
struct strbuf *sb)
{