checkout -m: fix read-tree invocation

When we updated "read-tree -m -u" to be careful about not
removing untracked working tree files, we broke "checkout -m" to
switch between branches.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2006-06-28 11:47:28 -07:00
parent 8f4a9b62ee
commit abc0267016
2 changed files with 73 additions and 2 deletions

View File

@ -150,8 +150,7 @@ else
# Match the index to the working tree, and do a three-way.
git diff-files --name-only | git update-index --remove --stdin &&
work=`git write-tree` &&
git read-tree --reset $new &&
git checkout-index -f -u -q -a &&
git read-tree --reset -u $new &&
git read-tree -m -u --aggressive $old $new $work || exit
if result=`git write-tree 2>/dev/null`