Re: [PATCH 6/9] t4013: add tests for log.diffMerges config
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Apr 7, 2021, 23:06 UTC
- Message-ID
- <87v98xitjh.fsf@evledraar.gmail.com>
- In-Reply-To
- <20210407225608.14611-7-sorganov@gmail.com>
On Thu, Apr 08 2021, Sergey Organov wrote:
Show 22 quoted lines
> Test that wrong values are denied. > > Test that the value of log.diffMerges properly affects both > --diff-merges=def and -m. > > Signed-off-by: Sergey Organov <sorganov@gmail.com> > --- > t/t4013-diff-various.sh | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh > index 275a6790896d..ee4afca06ced 100755 > --- a/t/t4013-diff-various.sh > +++ b/t/t4013-diff-various.sh > @@ -460,6 +460,32 @@ test_expect_success 'log --diff-merges=def matches --diff-merges=separate' ' > test_cmp expected actual > ' > > +test_expect_success 'deny wrong log.diffMerges config' ' > + git config log.diffMerges wrong-value && > + test_expect_code 128 git log && > + git config --unset log.diffMerges
Don't use "git config", but "test_config" at the start, then you don't need the --unset at the end, it'll happen automatically. Ditto for the following tests.
Show 25 quoted lines
> +' > + > +test_expect_success 'git config log.diffMerges first-parent' ' > + git log -p --diff-merges=first-parent master >result && > + process_diffs result >expected && > + git config log.diffMerges first-parent && > + git log -p --diff-merges=def master >result && > + process_diffs result >actual && > + git config --unset log.diffMerges && > + test_cmp expected actual > +' > + > +test_expect_success 'git config log.diffMerges first-parent vs -m' ' > + git log -p --diff-merges=first-parent master >result && > + process_diffs result >expected && > + git config log.diffMerges first-parent && > + git log -p -m master >result && > + process_diffs result >actual && > + git config --unset log.diffMerges && > + test_cmp expected actual > +' > + > test_expect_success 'log -S requires an argument' ' > test_must_fail git log -S > '