Re: [PATCH v2] worktree: add: fix 'post-checkout' not knowing new worktree location

2018-02-15 Thread Eric Sunshine
On Thu, Feb 15, 2018 at 4:27 PM, Eric Sunshine wrote: > On Thu, Feb 15, 2018 at 12:52:11PM -0800, Junio C Hamano wrote: >> This seems to segfault on me, without leaving hook.actual anywhere. > > I'm unable to reproduce the segfault, but I'm guessing it's because > I'm a

Re: [PATCH v2] worktree: add: fix 'post-checkout' not knowing new worktree location

2018-02-15 Thread Junio C Hamano
Eric Sunshine writes: > I'm a dummy. Can you squash in the following and retry? I haven't tried, but that does look like the right thing to do, whether it is the root cause of the fault I am seeing. Thanks. > > --- >8 --- > diff --git a/builtin/worktree.c

Re: [PATCH v2] worktree: add: fix 'post-checkout' not knowing new worktree location

2018-02-15 Thread Eric Sunshine
On Thu, Feb 15, 2018 at 12:52:11PM -0800, Junio C Hamano wrote: > Eric Sunshine writes: > > test_expect_success '"add" invokes post-checkout hook (branch)' ' > > post_checkout_hook && > > - printf "%s %s 1\n" $_z40 $(git rev-parse HEAD) >hook.expect && > > + { >

Re: [PATCH v2] worktree: add: fix 'post-checkout' not knowing new worktree location

2018-02-15 Thread Junio C Hamano
Eric Sunshine writes: > 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 && > +

[PATCH v2] worktree: add: fix 'post-checkout' not knowing new worktree location

2018-02-15 Thread Eric Sunshine
Although "git worktree add" learned to run the 'post-checkout' hook in ade546be47 (worktree: invoke post-checkout hook, 2017-12-07), it neglected to change to the directory of the newly-created worktree before running the hook. Instead, the hook runs within the directory from which the "git