Re: [PATCH v4] bugreport: collect list of populated hooks
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 8, 2020, 01:20 UTC
- Message-ID
- <xmqqlfm31atm.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200508005357.223058-1-emilyshaffer@google.com>
Emily Shaffer <emilyshaffer@google.com> writes:
Show 18 quoted lines
> diff --git a/t/t0091-bugreport.sh b/t/t0091-bugreport.sh > index 2e73658a5c..ff317cce68 100755 > --- a/t/t0091-bugreport.sh > +++ b/t/t0091-bugreport.sh > @@ -57,5 +57,20 @@ test_expect_success 'can create leading directories outside of a git dir' ' > nongit git bugreport -o foo/bar/baz > ' > > +test_expect_success 'indicates populated hooks' ' > + test_when_finished rm git-bugreport-hooks.txt && > + test_when_finished rm -fr .git/hooks && > + rm -fr .git/hooks && > + mkdir .git/hooks && > + for hook in applypatch-msg prepare-commit-msg.sample > + do > + write_script ".git/hooks/$hook" <<-\EOF || return 1 > + echo "hook $hook exists" > + EOF
Probably our mails crossed, but as I said in my response, this will make the hook say "hook exists" because $hook will be literally in the script file. EOF needs to be left unquoted, i.e.
write_script ".git/hooks/$hook" <<-EOF || return 1 ...
> + done && > + ...
Thanks.