On Mon, Mar 5, 2018 at 1:37 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > SZEDER Gábor <szeder.dev@xxxxxxxxx> writes: > >> Could you please save 'git worktree's output into an intermediate >> file, and run 'grep' on the file's contents? > > Here is what I tentatively came up with, while deciding what should > be queued based on Eric's patch, as a possible squash/fixup. Thanks for saving a round-trip. One comment below... > diff --git a/t/t2028-worktree-move.sh b/t/t2028-worktree-move.sh > @@ -74,8 +75,10 @@ test_expect_success 'move worktree' ' > toplevel="$(pwd)" && > git worktree move source destination && > test_path_is_missing source && > - git worktree list --porcelain | grep "^worktree.*/destination" && > - ! git worktree list --porcelain | grep "^worktree.*/source" && > + git worktree list --porcelain >out && > + grep "^worktree.*/destination" out && > + git worktree list --porcelain >out && > + ! grep "^worktree.*/source" out && The second "git worktree list --porcelain >out" can be dropped, leaving the two grep's back-to-back since it they can test the same 'out' file > git -C destination log --format=%s >actual2 && > echo init >expected2 && > test_cmp expected2 actual2