Re: [PATCH v5 1/3] builtin/config: introduce `--default`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 6, 2018 at 2:53 AM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> On Fri, Apr 6, 2018 at 2:30 AM, Taylor Blau <me@xxxxxxxxxxxx> wrote:
>> +test_expect_success 'uses entry when available' '
>> +       echo bar >expect &&
>> +       git config --add core.foo bar &&
>> +       git config --default baz core.foo >actual &&
>> +       git config --unset core.foo &&
>> +       test_cmp expect actual
>> +'
>
> If you happen to re-roll, can we move this test so it immediately
> follows the "uses --default when missing entry" test?

One other issue. If "git config --default ..." fails, the --unset line
will never be invoked, thus cleanup won't happen.

To ensure cleanup, either use:

    test_when_finished "git config --unset core.foo" &&

earlier in the test (just after the --add line) or use the
test_config() function to both set the value and ensure its cleanup.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux