diff options
author | Nickolai Belakovski <nbelakovski@gmail.com> | 2019-04-29 08:19:42 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-05-07 07:45:53 +0300 |
commit | 2582083fa1830632e298727e973440907345267f (patch) | |
tree | 7bbcd7f3b030eae3e6c93786272b65380afdeb5a /t/t6302-for-each-ref-filter.sh | |
parent | 0e94f7aa730b108f7907cfab1b2a7fba965de442 (diff) |
ref-filter: add worktreepath atom
Add an atom providing the path of the linked worktree where this ref is
checked out, if it is checked out in any linked worktrees, and empty
string otherwise.
Signed-off-by: Nickolai Belakovski <nbelakovski@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6302-for-each-ref-filter.sh')
-rwxr-xr-x | t/t6302-for-each-ref-filter.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh index fc067ed672..35408d53fd 100755 --- a/t/t6302-for-each-ref-filter.sh +++ b/t/t6302-for-each-ref-filter.sh @@ -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 |