diff options
Diffstat (limited to 't/t2022-checkout-paths.sh')
-rwxr-xr-x | t/t2022-checkout-paths.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t2022-checkout-paths.sh b/t/t2022-checkout-paths.sh index f46d0499bc..9ad74cebb2 100755 --- a/t/t2022-checkout-paths.sh +++ b/t/t2022-checkout-paths.sh @@ -78,4 +78,24 @@ test_expect_success 'do not touch files that are already up-to-date' ' test_cmp expect actual ' +test_expect_success 'working-tree-only option leaves checked out files unadded' ' + git reset --hard && + git checkout -b pu next && + echo another line >>file1 && + echo exists >file3 && + git add file3 && + git commit -a -m "another commit" && + git checkout next && + + ! grep "another line" file1 && + git checkout --working-tree-only pu file1 file3 && + grep "another line" file1 && + test_must_fail git grep --cached "another line" file1 && + + grep exists file3 && + git ls-files file3 >actual && + >expect && + test_cmp expect actual +' + test_done |