Re: [PATCH v2] git config: report when trying to modify a non-existing repo config

Subsystems: the rest

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v2] git config: report when trying to modify a non-existing repo config

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:08:25

Junio C Hamano [off-list ref] writes:
Johannes Schindelin [off-list ref] writes:
quoted
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

Re: [PATCH v2] git config: report when trying to modify a non-existing repo config

From: Johannes Schindelin <hidden>
Date: 2016-06-15 23:08:27

Hi Junio,

On Wed, 24 Feb 2016, Junio C Hamano wrote:
Junio C Hamano [off-list ref] writes:
quoted
Johannes Schindelin [off-list ref] writes:
quoted
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.
Please do, unless you want me to resend with the squashed commit (I picked
up the change from your 'pu' branch)?

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help