]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/update-index-ignore-removal-for-skip-worktree'
authorJunio C Hamano <gitster@pobox.com>
Sun, 10 Nov 2019 09:02:16 +0000 (18:02 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 10 Nov 2019 09:02:16 +0000 (18:02 +0900)
"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

1  2 
builtin/stash.c
builtin/update-index.c
git-legacy-stash.sh
t/t3903-stash.sh

diff --cc builtin/stash.c
Simple merge
Simple merge
Simple merge
index 580bfbdc23f4924cea78358629e09a974ad6aa6c,1e977145b83766d86561f5838d87d59fb8c3b2b4..a4da72f0ab4453451309bbdbafd24a0eee423a88
@@@ -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