summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2010-05-01 11:25:12 +0200
committerJunio C Hamano <gitster@pobox.com>2010-05-01 12:00:44 -0700
commitaecda37c66ecf215fc67b0b48998a8c69c10d5a5 (patch)
tree407e3028610895da47c16d6c29c0cc72b1385524 /unpack-trees.c
parente92e9cd3c388544f4f521736df844b37908c3879 (diff)
downloadgit-aecda37c66ecf215fc67b0b48998a8c69c10d5a5.tar.gz
do not overwrite files marked "assume unchanged"
A merge will fail gracefully if it needs to update files marked "assume unchanged", but other similar commands will not. In particular, checkout and rebase will silently overwrite changes to such files. This is a regression introduced in commit 1dcafcc0 (verify_uptodate(): add ce_uptodate(ce) test), which avoids lstat's during a merge, if the index entry is up-to-date. If the CE_VALID flag is set, however, we cannot trust CE_UPTODATE. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 75f54cac97..1a8030ced0 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -862,7 +862,7 @@ static int verify_uptodate_1(struct cache_entry *ce,
{
struct stat st;
- if (o->index_only || (!ce_skip_worktree(ce) && (o->reset || ce_uptodate(ce))))
+ if (o->index_only || (!((ce->ce_flags & CE_VALID) || ce_skip_worktree(ce)) && (o->reset || ce_uptodate(ce))))
return 0;
if (!lstat(ce->name, &st)) {