Merge branch 'sg/git-C-empty-doc'
[gitweb.git] / t / t6302-for-each-ref-filter.sh
index fc067ed6723bc0aaaddd2473e4d61f13087b9e15..35408d53fd8af5d627326dd2a47e532d64a4c304 100755 (executable)
@@ -441,4 +441,17 @@ test_expect_success '--merged is incompatible with --no-merged' '
        test_must_fail git for-each-ref --merged HEAD --no-merged HEAD
 '
 
+test_expect_success 'validate worktree atom' '
+       cat >expect <<-EOF &&
+       master: $(pwd)
+       master_worktree: $(pwd)/worktree_dir
+       side: not checked out
+       EOF
+       git worktree add -b master_worktree worktree_dir master &&
+       git for-each-ref --format="%(refname:short): %(if)%(worktreepath)%(then)%(worktreepath)%(else)not checked out%(end)" refs/heads/ >actual &&
+       rm -r worktree_dir &&
+       git worktree prune &&
+       test_cmp expect actual
+'
+
 test_done