Re: [PATCH 07/12] t4150: am with applypatch-msg hook
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 6, 2015, 17:46 UTC
- Message-ID
- <xmqqk2ud18nt.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1435861000-25278-8-git-send-email-pyokagan@gmail.com>
Paul Tan <pyokagan@gmail.com> writes:
Show 12 quoted lines
> +test_expect_success 'am with applypatch-msg hook' ' > + test_when_finished "rm -f .git/hooks/applypatch-msg" && > + rm -fr .git/rebase-apply && > + git reset --hard && > + git checkout first && > + mkdir -p .git/hooks && > + cat >.git/hooks/applypatch-msg <<-\EOF && > + #!/bin/sh > + cat "$1" >actual-msg && > + echo hook-message >"$1" > + EOF > + chmod +x .git/hooks/applypatch-msg &&
This (and the other one below) looks like a good candidate for the write_script helper.
Show 30 quoted lines
> + git am patch1 && > + test_path_is_missing .git/rebase-apply && > + git diff --exit-code second && > + echo hook-message >expected && > + git log -1 --format=format:%B >actual && > + test_cmp expected actual && > + git log -1 --format=format:%B second >expected && > + test_cmp expected actual-msg > +' > + > +test_expect_success 'am with failing applypatch-msg hook' ' > + test_when_finished "rm -f .git/hooks/applypatch-msg" && > + rm -fr .git/rebase-apply && > + git reset --hard && > + git checkout first && > + mkdir -p .git/hooks && > + cat >.git/hooks/applypatch-msg <<-\EOF && > + #!/bin/sh > + exit 1 > + EOF > + chmod +x .git/hooks/applypatch-msg && > + test_must_fail git am patch1 && > + test_path_is_dir .git/rebase-apply && > + git diff --exit-code first && > + test_cmp_rev first HEAD > +' > + > test_expect_success 'setup: new author and committer' ' > GIT_AUTHOR_NAME="Another Thor" && > GIT_AUTHOR_EMAIL="a.thor@example.com" &&