diff options
Diffstat (limited to 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/diff-lib.c b/diff-lib.c index 298265e5b5..7eb66a417a 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -651,6 +651,7 @@ int index_differs_from(struct repository *r, { struct rev_info rev; struct setup_revision_opt opt; + unsigned has_changes; repo_init_revisions(r, &rev, NULL); memset(&opt, 0, sizeof(opt)); @@ -662,8 +663,9 @@ int index_differs_from(struct repository *r, diff_flags_or(&rev.diffopt.flags, flags); rev.diffopt.ita_invisible_in_index = ita_invisible_in_index; run_diff_index(&rev, 1); + has_changes = rev.diffopt.flags.has_changes; release_revisions(&rev); - return (rev.diffopt.flags.has_changes != 0); + return (has_changes != 0); } static struct strbuf *idiff_prefix_cb(struct diff_options *opt, void *data) |