mirror of
https://github.com/git/git.git
synced 2025-03-28 16:33:17 +00:00
Merge branch 'jk/stash-disable-renames-internally'
When diff.renames configuration is on (and with Git 2.9 and later, it is enabled by default, which made it worse), "git stash" misbehaved if a file is removed and another file with a very similar content is added. * jk/stash-disable-renames-internally: stash: prefer plumbing over git-diff
This commit is contained in:
commit
db09f21bbd
@ -115,7 +115,7 @@ create_stash () {
|
|||||||
git read-tree --index-output="$TMPindex" -m $i_tree &&
|
git read-tree --index-output="$TMPindex" -m $i_tree &&
|
||||||
GIT_INDEX_FILE="$TMPindex" &&
|
GIT_INDEX_FILE="$TMPindex" &&
|
||||||
export GIT_INDEX_FILE &&
|
export GIT_INDEX_FILE &&
|
||||||
git diff --name-only -z HEAD -- >"$TMP-stagenames" &&
|
git diff-index --name-only -z HEAD -- >"$TMP-stagenames" &&
|
||||||
git update-index -z --add --remove --stdin <"$TMP-stagenames" &&
|
git update-index -z --add --remove --stdin <"$TMP-stagenames" &&
|
||||||
git write-tree &&
|
git write-tree &&
|
||||||
rm -f "$TMPindex"
|
rm -f "$TMPindex"
|
||||||
|
@ -766,4 +766,13 @@ test_expect_success 'stash list --cc shows combined diff' '
|
|||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'stash is not confused by partial renames' '
|
||||||
|
mv file renamed &&
|
||||||
|
git add renamed &&
|
||||||
|
git stash &&
|
||||||
|
git stash apply &&
|
||||||
|
test_path_is_file renamed &&
|
||||||
|
test_path_is_missing file
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user