Skip to content

Commit

Permalink
Allow one-way tree merge to remove old files
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed May 14, 2006
1 parent 975bf9c commit 76b99b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion read-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ static int oneway_merge(struct cache_entry **src)
merge_size);

if (!a)
return 0;
return deleted_entry(old, NULL);
if (old && same(old, a)) {
return keep_entry(old);
}
Expand Down

0 comments on commit 76b99b8

Please sign in to comment.