Git development
 help / color / mirror / Atom feed
* Allow one-way tree merge to remove old files
@ 2006-05-14 17:43 Linus Torvalds
  2006-05-14 17:51 ` Junio C Hamano
  2006-05-14 18:20 ` Simplify "git reset --hard" Linus Torvalds
  0 siblings, 2 replies; 8+ messages in thread
From: Linus Torvalds @ 2006-05-14 17:43 UTC (permalink / raw)
  To: Junio C Hamano, Git Mailing List


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);
 	}

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-05-15 15:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-14 17:43 Allow one-way tree merge to remove old files Linus Torvalds
2006-05-14 17:51 ` Junio C Hamano
2006-05-14 18:20 ` Simplify "git reset --hard" Linus Torvalds
2006-05-15  6:55   ` Junio C Hamano
2006-05-15  7:08     ` Junio C Hamano
2006-05-15  7:46       ` Junio C Hamano
2006-05-15 14:55         ` Linus Torvalds
2006-05-15 15:09           ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox