Re: [PATCH v4] bugreport: collect list of populated hooks
From: Junio C Hamano <hidden>
Date: 2020-05-08 01:20:58
Emily Shaffer [off-list ref] writes:
quoted hunk
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.