From 27b30be686e497e6ab84dc0b25623df7aba1ba2c Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sun, 28 Feb 2016 11:54:35 +0000 Subject: config: fail if --get-urlmatch finds no value The --get, --get-all and --get-regexp options to git-config exit with status 1 if the key is not found but --get-urlmatch succeeds in this case. Change --get-urlmatch to behave in the same way as the other --get* options so that all four are consistent. --get-color is a special case because it accepts a default value to return and so should not return an error if the key is not found. Also clarify this behaviour in the documentation. Signed-off-by: John Keeping Signed-off-by: Junio C Hamano --- t/t1300-repo-config.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 't/t1300-repo-config.sh') diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 52678e7d0a..175e73cbb6 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -1140,6 +1140,9 @@ test_expect_success 'urlmatch' ' cookieFile = /tmp/cookie.txt EOF + test_expect_code 1 git config --bool --get-urlmatch doesnt.exist https://good.example.com >actual && + test_must_be_empty actual && + echo true >expect && git config --bool --get-urlmatch http.SSLverify https://good.example.com >actual && test_cmp expect actual && -- cgit v1.2.3