git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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, 22:31 UTC
Message-ID
<xmqqlh69spt4.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqq60xduauv.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 24 quoted lines
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
>
>> 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_.
I'd squash this in.
Thanks.
 t/t1308-config-set.sh | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh
index f62409e..9863d0d 100755
--- a/t/t1308-config-set.sh
+++ b/t/t1308-config-set.sh
@@ -220,11 +220,13 @@ test_expect_success 'check line errors for malformed values' '
 
 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
+	(
+		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
Previous: Junio C HamanoNext: Johannes Schindelin
Message 15 of 16 in “git config: do not create .git/ if it does not exist yet”
  1. git config: do not create .git/ if it does not exist yetJohannes Schindelin, Feb 24, 2016
  2. Jeff KingFeb 24, 2016
  3. John KeepingFeb 24, 2016
  4. Jeff KingFeb 24, 2016
  5. Johannes SchindelinFeb 24, 2016
  6. Johannes SchindelinFeb 24, 2016
  7. Jeff KingFeb 24, 2016
  8. Junio C HamanoFeb 24, 2016
  9. Duy NguyenFeb 24, 2016
  10. git config: report when trying to modify a non-existing repo configJohannes Schindelin, Feb 24, 2016
  11. Duy NguyenFeb 24, 2016
  12. Johannes SchindelinFeb 24, 2016
  13. Duy NguyenFeb 24, 2016
  14. Junio C HamanoFeb 24, 2016
  15. Junio C HamanoFeb 24, 2016
  16. Johannes SchindelinFeb 25, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.