1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-08 20:16:10 +02:00

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>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2018-09-21 17:57:18 +02:00 committed by Junio C Hamano
parent ce3a7ec8bd
commit 92a1bf5a58
2 changed files with 2 additions and 2 deletions

View File

@ -703,7 +703,7 @@ extern int unmerged_index(const struct index_state *);
* provided, the space-separated list of files that differ will be appended
* to it.
*/
extern int index_has_changes(const struct index_state *istate,
extern int index_has_changes(struct index_state *istate,
struct tree *tree,
struct strbuf *sb);

View File

@ -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)
{