{"thread":{"id":"41831","subject":"[PATCH v2] t7012: Implement test for git-checkout","startedAt":"2016-03-25T23:34:07Z","lastAt":"2016-03-25T23:39:38Z","messageCount":2,"participants":["Chhatoi Pritam Baral"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"281895","messageId":"56F5CAEF.9070906@gmail.com","threadId":"41831","inReplyTo":null,"subject":"[PATCH v2] t7012: Implement test for git-checkout","fromName":"Chhatoi Pritam Baral","fromEmail":"chhatoipritam@gmail.com","sentAt":"2016-03-25T23:34:07Z","receivedAt":"2016-03-25T23:34:07Z","isPatch":true,"sender":{"key":"chhatoipritam@gmail.com","avatar":"https://gravatar.com/avatar/2c5ac133640a20922f83e09e7b146a5cd5ad2472ee325969573401c048e78cbd?d=mp&s=160"},"body":"Previously a TODO; add a test for git-checkout skipping a\nfile with the skip-worktree bit set.\n\nSigned-off-by: Chhatoi Pritam Baral <chhatoipritam@gmail.com>\n---\n\nThis is a microproject for my GSoC '16 application.\n\nThanks, Torsten, for pointing out my mistakes. :)\nIt was my first time sending patches in mail (and not as attachments).\n\n t/t7012-skip-worktree-writing.sh | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7012-skip-worktree-writing.sh\nb/t/t7012-skip-worktree-writing.sh\nindex 9ceaa40..276f076 100755\n--- a/t/t7012-skip-worktree-writing.sh\n+++ b/t/t7012-skip-worktree-writing.sh\n@@ -141,6 +141,16 @@ test_expect_success 'git-clean, dirty case' '\n #TODO test_expect_failure 'git-apply removes file' false\n #TODO test_expect_failure 'git-mv to skip-worktree' false\n #TODO test_expect_failure 'git-mv from skip-worktree' false\n-#TODO test_expect_failure 'git-checkout' false\n+\n+test_expect_success 'git-checkout ignores skip-worktree file' '\n+\techo >1 &&\n+\tgit commit -m \"Add files\" &&\n+\techo dirty >1 &&\n+\techo dirty >2 &&\n+\tgit update-index --skip-worktree 1 &&\n+\tgit checkout -- . &&\n+\tgrep -q dirty 1 &&\n+\ttest_must_fail grep -q dirty 2\n+'\n  test_done\n-- \n2.7.4\n"},{"id":"281896","messageId":"56F5CC3A.90500@gmail.com","threadId":"41831","inReplyTo":"56F5CAEF.9070906@gmail.com","subject":"Re: [PATCH v2] t7012: Implement test for git-checkout","fromName":"Chhatoi Pritam Baral","fromEmail":"chhatoipritam@gmail.com","sentAt":"2016-03-25T23:39:38Z","receivedAt":"2016-03-25T23:39:38Z","isPatch":true,"sender":{"key":"chhatoipritam@gmail.com","avatar":"https://gravatar.com/avatar/2c5ac133640a20922f83e09e7b146a5cd5ad2472ee325969573401c048e78cbd?d=mp&s=160"},"body":"\n\nOn 03/26/2016 05:04 AM, Chhatoi Pritam Baral wrote:\n> Previously a TODO; add a test for git-checkout skipping a\n> file with the skip-worktree bit set.\n>\n> Signed-off-by: Chhatoi Pritam Baral <chhatoipritam@gmail.com>\n> ---\n>\n> This is a microproject for my GSoC '16 application.\n>\n> Thanks, Torsten, for pointing out my mistakes. :)\n> It was my first time sending patches in mail (and not as attachments).\n>\n>  t/t7012-skip-worktree-writing.sh | 12 +++++++++++-\n>  1 file changed, 11 insertions(+), 1 deletion(-)\n>\n> diff --git a/t/t7012-skip-worktree-writing.sh\n> b/t/t7012-skip-worktree-writing.sh\n> index 9ceaa40..276f076 100755\n> --- a/t/t7012-skip-worktree-writing.sh\n> +++ b/t/t7012-skip-worktree-writing.sh\n> @@ -141,6 +141,16 @@ test_expect_success 'git-clean, dirty case' '\n>  #TODO test_expect_failure 'git-apply removes file' false\n>  #TODO test_expect_failure 'git-mv to skip-worktree' false\n>  #TODO test_expect_failure 'git-mv from skip-worktree' false\n> -#TODO test_expect_failure 'git-checkout' false\n> +\n> +test_expect_success 'git-checkout ignores skip-worktree file' '\n> +\techo >1 &&\n> +\tgit commit -m \"Add files\" &&\n> +\techo dirty >1 &&\n> +\techo dirty >2 &&\n> +\tgit update-index --skip-worktree 1 &&\n> +\tgit checkout -- . &&\n> +\tgrep -q dirty 1 &&\n> +\ttest_must_fail grep -q dirty 2\nAs Eric mentioned on another thread, test_must_fail needs replacing with\n'!'.\n\nI'll just wait a while, let the two thread collect responses before I\nbegin a v3 thread.\n> +'\n>   test_done\n"}]}