Use merge-recursive in git-checkout -m (branch switching)
This allows "git checkout -m <other-branch>" to notice renames and carry local changes in the working tree forward. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
@ -201,8 +201,9 @@ else
|
||||
git diff-files --name-only | git update-index --remove --stdin &&
|
||||
work=`git write-tree` &&
|
||||
git read-tree --reset -u $new &&
|
||||
git read-tree -m -u --aggressive --exclude-per-directory=.gitignore $old $new $work ||
|
||||
exit
|
||||
eval GITHEAD_$new=${new_name:-${branch:-$new}} GITHEAD_$work=local &&
|
||||
export GITHEAD_$new GITHEAD_$work &&
|
||||
git merge-recursive $old -- $new $work || exit
|
||||
|
||||
if result=`git write-tree 2>/dev/null`
|
||||
then
|
||||
|
||||
Reference in New Issue
Block a user