diff mbox series

[12/14] test: completion: use global config

Message ID 20190621223107.8022-13-felipe.contreras@gmail.com (mailing list archive)
State New, archived
Headers show
Series completion: a bunch of updates | expand

Commit Message

Felipe Contreras June 21, 2019, 10:31 p.m. UTC
When appropriate.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/t9902-completion.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Junio C Hamano July 3, 2019, 5:22 p.m. UTC | #1
Felipe Contreras <felipe.contreras@gmail.com> writes:

> When appropriate.

It is unclear what makes these (but not other use of test_config)
appropriate.

>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  t/t9902-completion.sh | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
> index 7bef41eaf5..3dbfef6960 100755
> --- a/t/t9902-completion.sh
> +++ b/t/t9902-completion.sh
> @@ -1497,9 +1497,9 @@ test_expect_success 'git --help completion' '
>  	test_completion "git --help core" "core-tutorial "
>  '
>  
> -test_expect_failure 'completion.commands removes multiple commands' '
> +test_expect_success 'completion.commands removes multiple commands' '
>  	offgit &&
> -	test_config completion.commands "-cherry -mergetool" &&
> +	test_config_global completion.commands "-cherry -mergetool" &&

This feels more like fixing a bug introduced by step 11/14 in that
(besides doing "offgit" that affects global test environment outside
a subshell) we want to do this test outside a repository so there is
no appropriate "local" configuration "git config" (hence test_config)
can touch.  IOW, shouldn't this have been done in the step 11/14 when
"offgit" was added?
diff mbox series

Patch

diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 7bef41eaf5..3dbfef6960 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1497,9 +1497,9 @@  test_expect_success 'git --help completion' '
 	test_completion "git --help core" "core-tutorial "
 '
 
-test_expect_failure 'completion.commands removes multiple commands' '
+test_expect_success 'completion.commands removes multiple commands' '
 	offgit &&
-	test_config completion.commands "-cherry -mergetool" &&
+	test_config_global completion.commands "-cherry -mergetool" &&
 	git --list-cmds=list-mainporcelain,list-complete,config >out &&
 	! grep -E "^(cherry|mergetool)$" out
 '
@@ -1637,7 +1637,7 @@  test_expect_success 'complete files' '
 '
 
 test_expect_success "completion uses <cmd> completion for alias: !sh -c 'git <cmd> ...'" '
-	test_config alias.co "!sh -c '"'"'git checkout ...'"'"'" &&
+	test_config_global alias.co "!sh -c '"'"'git checkout ...'"'"'" &&
 	test_completion "git co m" <<-\EOF
 	master Z
 	mybranch Z
@@ -1646,7 +1646,7 @@  test_expect_success "completion uses <cmd> completion for alias: !sh -c 'git <cm
 '
 
 test_expect_success 'completion uses <cmd> completion for alias: !f () { VAR=val git <cmd> ... }' '
-	test_config alias.co "!f () { VAR=val git checkout ... ; } f" &&
+	test_config_global alias.co "!f () { VAR=val git checkout ... ; } f" &&
 	test_completion "git co m" <<-\EOF
 	master Z
 	mybranch Z
@@ -1655,7 +1655,7 @@  test_expect_success 'completion uses <cmd> completion for alias: !f () { VAR=val
 '
 
 test_expect_success 'completion used <cmd> completion for alias: !f() { : git <cmd> ; ... }' '
-	test_config alias.co "!f() { : git checkout ; if ... } f" &&
+	test_config_global alias.co "!f() { : git checkout ; if ... } f" &&
 	test_completion "git co m" <<-\EOF
 	master Z
 	mybranch Z