On Thu, Jan 3, 2019 at 12:40 AM Jeff King <[email protected]> wrote:
> On Mon, Dec 24, 2018 at 12:47:54AM -0800, [email protected] wrote:
> > +test_expect_success 'validate worktree atom' '
> > + {
> > + echo master: $PWD &&
> > + echo master_worktree: $PWD/worktree_dir &&
> > + echo side: not checked out
> > + } > expect &&
>
> Minor style nit: use "} >expect" without the extra space.
An interpolating here-doc would be even more natural:
cat >expect <-EOF &&
master: $(pwd)
master_worktree: $(pwd)/worktree_dir
side: not checked out
EOF
> This checks the actual directories. Good. I can never remember the rules
> for when to use $PWD versus $(pwd) on Windows. We may run afoul of the
> distinction here.
As I understand it, this is exactly a case in which you would need to
use $(pwd); namely, when coming up with an "expect" value. t/README
talks about it.