Skip to content

Commit 277292d

Browse files
newrengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a35edc8 commit 277292d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

merge-recursive.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,9 +842,9 @@ static int was_dirty(struct merge_options *o, const char *path)
842842
if (o->call_depth || !was_tracked(o, path))
843843
return !dirty;
844844

845-
ce = cache_file_exists(path, strlen(path), ignore_case);
846-
dirty = (ce->ce_stat_data.sd_mtime.sec > 0 &&
847-
verify_uptodate(ce, &o->unpack_opts) != 0);
845+
ce = index_file_exists(o->unpack_opts.src_index,
846+
path, strlen(path), ignore_case);
847+
dirty = verify_uptodate(ce, &o->unpack_opts) != 0;
848848
return dirty;
849849
}
850850

0 commit comments

Comments
 (0)