Re: [PATCH v2] git config: report when trying to modify a non-existing repo config
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 24, 2016, 20:11 UTC
- Message-ID
- <xmqq60xduauv.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <b225aec8c83a184f90dc6bfa821177b52ef4b3f4.1456318031.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 18 quoted lines
> diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh > index 91235b7..f62409e 100755 > --- a/t/t1308-config-set.sh > +++ b/t/t1308-config-set.sh > @@ -218,4 +218,13 @@ test_expect_success 'check line errors for malformed values' ' > test_i18ngrep "fatal: .*alias\.br.*\.git/config.*line 2" result > ' > > +test_expect_success 'error on modifying repo config without repo' ' > + mkdir no-repo && > + GIT_CEILING_DIRECTORIES=$(pwd) && > + export GIT_CEILING_DIRECTORIES && > + cd no-repo && > + test_must_fail git config a.b c 2>err && > + grep "not in a git directory" err > +' > + > test_done
Please make it a habit to run tests that go up/down in the hierarchy in a subshell. It is not a good excuse that this new test happens to be at the end _right now_.