From: Chhatoi Pritam Baral Date: Fri, 25 Mar 2016 17:36:20 GMT Subject: [PATCH] t7012: Implement test for git-checkout Message-ID: <56F57714.4050708@gmail.com> Previously a TODO, this patch adds a test for git-checkout skipping a file with the skip-worktree bit set. I'm doing this as a microproject for my GSoC '16 application. Signed-off-by: Chhatoi Pritam Baral --- t/t7012-skip-worktree-writing.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/t/t7012-skip-worktree-writing.sh b/t/t7012-skip-worktree-writing.sh index 9ceaa40..d5b42d6 100755 --- a/t/t7012-skip-worktree-writing.sh +++ b/t/t7012-skip-worktree-writing.sh @@ -141,6 +141,16 @@ test_expect_success 'git-clean, dirty case' ' #TODO test_expect_failure 'git-apply removes file' false #TODO test_expect_failure 'git-mv to skip-worktree' false #TODO test_expect_failure 'git-mv from skip-worktree' false -#TODO test_expect_failure 'git-checkout' false + +test_expect_success 'git-checkout ignores skip-worktree file' ' + echo > 1 && + git commit -m "Add files" && + echo dirty > 1 && + echo dirty > 2 && + git update-index --skip-worktree 1 && + git checkout -- . && + grep -q dirty 1 && + test_must_fail grep -q dirty 2 +' test_done -- 2.7.4