diff options
| author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-01-12 09:13:31 +0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-01-14 12:13:05 -0800 |
| commit | 150fe065f71778a6591566d6fde65171569a4b7a (patch) | |
| tree | cdc2d2eaca21cb971756601af4cfa67af0545281 /read-cache.c | |
| parent | merge-recursive.c: remove implicit dependency on the_repository (diff) | |
| download | git-150fe065f71778a6591566d6fde65171569a4b7a.tar.gz git-150fe065f71778a6591566d6fde65171569a4b7a.zip | |
read-cache.c: remove the_* from index_has_changes()
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.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/read-cache.c b/read-cache.c index 61cc0571da..2549477ed2 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2365,22 +2365,20 @@ int unmerged_index(const struct index_state *istate) return 0; } -int index_has_changes(struct index_state *istate, - struct tree *tree, - struct strbuf *sb) +int repo_index_has_changes(struct repository *repo, + struct tree *tree, + struct strbuf *sb) { + struct index_state *istate = repo->index; struct object_id cmp; int i; - if (istate != &the_index) { - BUG("index_has_changes cannot yet accept istate != &the_index; do_diff_cache needs updating first."); - } if (tree) cmp = tree->object.oid; if (tree || !get_oid_tree("HEAD", &cmp)) { struct diff_options opt; - repo_diff_setup(the_repository, &opt); + repo_diff_setup(repo, &opt); opt.flags.exit_with_status = 1; if (!sb) opt.flags.quick = 1; |
