summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2018-04-19 17:58:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-08 07:11:00 (GMT)
commit277292d5ae27993d36f35fdd8d561c369b1e0962 (patch)
tree4530980d5d562b852fb4e9e7c096073a379dd286 /merge-recursive.c
parenta35edc84bdd6134d7aaa7bb0d220941154fe9e7e (diff)
downloadgit-277292d5ae27993d36f35fdd8d561c369b1e0962.zip
git-277292d5ae27993d36f35fdd8d561c369b1e0962.tar.gz
git-277292d5ae27993d36f35fdd8d561c369b1e0962.tar.bz2
merge-recursive: fix remainder of was_dirty() to use original index
was_dirty() uses was_tracked(), which has been updated to use the original index rather than the current one. However, was_dirty() also had a separate call to cache_file_exists(), causing it to still implicitly use the current index. Update that to instead use index_file_exists(). Also, was_dirty() had a hack where it would mark any file as non-dirty if we simply didn't know its modification time. This was due to using the current index rather than the original index, because D/F conflicts and such would cause unpack_trees() to not copy the modification times from the original index to the current one. Now that we are using the original index, we can dispense with this hack. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index f747862..9015be5 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -842,9 +842,9 @@ static int was_dirty(struct merge_options *o, const char *path)
if (o->call_depth || !was_tracked(o, path))
return !dirty;
- ce = cache_file_exists(path, strlen(path), ignore_case);
- dirty = (ce->ce_stat_data.sd_mtime.sec > 0 &&
- verify_uptodate(ce, &o->unpack_opts) != 0);
+ ce = index_file_exists(o->unpack_opts.src_index,
+ path, strlen(path), ignore_case);
+ dirty = verify_uptodate(ce, &o->unpack_opts) != 0;
return dirty;
}