From: Johannes Sixt Date: Tue, 13 Feb 2018 07:27:17 GMT Subject: Re: [PATCH 2/2] worktree: add: change to new worktree directory before running hook Message-ID: In-Reply-To: <20180212031526.40039-3-sunshine@sunshineco.com> Am 12.02.2018 um 04:15 schrieb Eric Sunshine: > --- a/t/t2025-worktree-add.sh > +++ b/t/t2025-worktree-add.sh > @@ -454,20 +454,29 @@ post_checkout_hook () { > test_when_finished "rm -f .git/hooks/post-checkout" && > mkdir -p .git/hooks && > write_script .git/hooks/post-checkout <<-\EOF > - echo $* >hook.actual > + { > + echo $* > + git rev-parse --show-toplevel > + } >../hook.actual > EOF > } > > test_expect_success '"add" invokes post-checkout hook (branch)' ' > post_checkout_hook && > - printf "%s %s 1\n" $_z40 $(git rev-parse HEAD) >hook.expect && > + { > + echo $_z40 $(git rev-parse HEAD) 1 && > + echo $(pwd)/gumby $(pwd) is here and in the other tests correct. $PWD would be wrong on Windows. Thanks for being considerate. > + } >hook.expect && > git worktree add gumby && > test_cmp hook.expect hook.actual -- Hannes