From: Junio C Hamano Date: Sun, 10 Nov 2019 09:02:16 +0000 (+0900) Subject: Merge branch 'js/update-index-ignore-removal-for-skip-worktree' X-Git-Tag: v2.25.0-rc0~136 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fgit.git;a=commitdiff_plain;h=57b530125e022de79f5f0b208bc0a5ee67c18b77 Merge branch 'js/update-index-ignore-removal-for-skip-worktree' "git stash save" in a working tree that is sparsely checked out mistakenly removed paths that are outside the area of interest. * js/update-index-ignore-removal-for-skip-worktree: stash: handle staged changes in skip-worktree files correctly update-index: optionally leave skip-worktree entries alone --- 57b530125e022de79f5f0b208bc0a5ee67c18b77 diff --cc t/t3903-stash.sh index 580bfbdc23,1e977145b8..a4da72f0ab --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@@ -1253,20 -1241,15 +1253,31 @@@ test_expect_success 'stash --keep-inde test_path_is_missing to-remove ' +test_expect_success 'stash apply should succeed with unmodified file' ' + echo base >file && + git add file && + git commit -m base && + + # now stash a modification + echo modified >file && + git stash && + + # make the file stat dirty + cp file other && + mv other file && + + git stash apply +' + + test_expect_success 'stash handles skip-worktree entries nicely' ' + test_commit A && + echo changed >A.t && + git add A.t && + git update-index --skip-worktree A.t && + rm A.t && + git stash && + + git rev-parse --verify refs/stash:A.t + ' + test_done