Thread (2 messages) flat view 2 messages, 1 author, 2016-06-15

Allow one-way tree merge to remove old files

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:25
Subsystem: the rest · Maintainer: Linus Torvalds

For some random reason (probably just because nobody noticed), the one-way 
merge strategy didn't mark deleted files as deleted, so if you used

	git-read-tree -m -u <newtree>

it would update the files that got changed in the index, but it would not 
delete the files that got deleted.

This should fix it, and I can't imagine that anybody depends on the old 
strange "update only existing files" behaviour.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/read-tree.c b/read-tree.c
index e926e4c..11157f4 100644
--- a/read-tree.c
+++ b/read-tree.c
@@ -684,7 +684,7 @@ static int oneway_merge(struct cache_ent
 			     merge_size);
 
 	if (!a)
-		return 0;
+		return deleted_entry(old, NULL);
 	if (old && same(old, a)) {
 		return keep_entry(old);
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help