Re: [PATCH v2 1/2] t5403:introduce check_post_checkout helper function
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 12, 2026, 14:48 UTC
- Message-ID
- <xmqq4ioqopjf.fsf@gitster.g>
- In-Reply-To
- <20260112065301.1290-2-deveshigurgaon@gmail.com>
Deveshi Dwivedi <deveshigurgaon@gmail.com> writes:
Show 12 quoted lines
> The test file repeatedly uses the same four-line pattern to validate > post-checkout hook arguments: read the args file, then test each of > the three values individually. > > Introduce a check_post_checkout helper function that encapsulates this > pattern. This patch does not change test behavior; it prepares the > code for improvement in the next step. > > Signed-off-by: Deveshi Dwivedi <deveshigurgaon@gmail.com> > --- > t/t5403-post-checkout-hook.sh | 49 ++++++++++++++++++++--------------- > 1 file changed, 28 insertions(+), 21 deletions(-)
OK.
Show 13 quoted lines
> diff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh > index 1462e3365b..7bdea25107 100755 > --- a/t/t5403-post-checkout-hook.sh > +++ b/t/t5403-post-checkout-hook.sh > ... > @@ -109,7 +115,8 @@ test_expect_success 'post-checkout hook is triggered by clone' ' > echo "$@" >"$GIT_DIR/post-checkout.args" > EOF > git clone --template=templates . clone3 && > - test_path_is_file clone3/.git/post-checkout.args > + check_post_checkout clone3/.git/post-checkout.args \ > + "$(test_oid zero)" "$(git -C clone3 rev-parse HEAD)" 1 > '
All other hunks are as described but this one is slightly different, which may want a mention in the proposed log message. We used to only care about the fact that post-checkout hook was executed, but now we check that we invoke the hook with expected parameters.
Other than that, this looks good; so does the next step.
Thanks.