summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c68998f)
raw | patch | inline | side by side (parent: c68998f)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 15 May 2006 07:46:05 +0000 (00:46 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 15 May 2006 07:46:57 +0000 (00:46 -0700) |
The "-u" flag means "update the working tree files", but to
other types of merges, it also implies "I want to keep my local
changes" -- because they prevent local changes from getting lost
by using verify_uptodate. The one-way merge is different from
other merges in that its purpose is opposite of doing something
else while keeping unrelated local changes. The point of
one-way merge is to nuke local changes. So while it feels
somewhat wrong that this actively loses local changes, it is the
right thing to do.
Signed-off-by: Junio C Hamano <junkio@cox.net>
other types of merges, it also implies "I want to keep my local
changes" -- because they prevent local changes from getting lost
by using verify_uptodate. The one-way merge is different from
other merges in that its purpose is opposite of doing something
else while keeping unrelated local changes. The point of
one-way merge is to nuke local changes. So while it feels
somewhat wrong that this actively loses local changes, it is the
right thing to do.
Signed-off-by: Junio C Hamano <junkio@cox.net>
read-tree.c | patch | blob | history |
diff --git a/read-tree.c b/read-tree.c
index 11157f42426d7f1783420e1a5fa72379ee759e6a..59b6a6bff9bc0b2dc7c922bf8e8b16cf36573fc7 100644 (file)
--- a/read-tree.c
+++ b/read-tree.c
if (!a)
return deleted_entry(old, NULL);
if (old && same(old, a)) {
+ struct stat st;
+ if (lstat(old->name, &st) || ce_match_stat(old, &st, 1))
+ old->ce_flags |= htons(CE_UPDATE);
return keep_entry(old);
}
return merged_entry(a, NULL);