diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-09-01 00:38:50 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-01 00:38:50 +0200 |
commit | fc9dfda1be25ab3bb311900c6cfbf59d6b6e224e (patch) | |
tree | 6a53a2a3de541f1c7155f4163086ab49a5c81a43 /t | |
parent | Sync with 2.5.1 (diff) | |
parent | get_urlmatch: avoid useless strbuf write (diff) | |
download | git-fc9dfda1be25ab3bb311900c6cfbf59d6b6e224e.tar.xz git-fc9dfda1be25ab3bb311900c6cfbf59d6b6e224e.zip |
Merge branch 'sg/config-name-only'
"git config --list" output was hard to parse when values consist of
multiple lines. "--name-only" option is added to help this.
* sg/config-name-only:
get_urlmatch: avoid useless strbuf write
format_config: simplify buffer handling
format_config: don't init strbuf
config: restructure format_config() for better control flow
completion: list variable names reliably with 'git config --name-only'
config: add '--name-only' option to list only variable names
Diffstat (limited to 't')
-rwxr-xr-x | t/t1300-repo-config.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 66dd28644f..52678e7d0a 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -353,6 +353,18 @@ test_expect_success '--list without repo produces empty output' ' ' cat > expect << EOF +beta.noindent +nextsection.nonewline +123456.a123 +version.1.2.3eX.alpha +EOF + +test_expect_success '--name-only --list' ' + git config --name-only --list >output && + test_cmp expect output +' + +cat > expect << EOF beta.noindent sillyValue nextsection.nonewline wow2 for me EOF @@ -363,6 +375,16 @@ test_expect_success '--get-regexp' ' ' cat > expect << EOF +beta.noindent +nextsection.nonewline +EOF + +test_expect_success '--name-only --get-regexp' ' + git config --name-only --get-regexp in >output && + test_cmp expect output +' + +cat > expect << EOF wow2 for me wow4 for you EOF |