diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-06-30 23:49:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-06-30 23:49:01 -0700 |
commit | cd5ada993d6a992eaed1c416f9a2ed6ba9c4cb6d (patch) | |
tree | 4d8b5629f61ad37e90399adaeeb070201b71a937 /t/t1300-repo-config.sh | |
parent | 8b4edcf04d3126612e843d2061c0e3472fc7d46a (diff) | |
parent | db1696b8ab1d1bde67e78c773c58d837fa8b5e70 (diff) | |
download | git-cd5ada993d6a992eaed1c416f9a2ed6ba9c4cb6d.tar.gz git-cd5ada993d6a992eaed1c416f9a2ed6ba9c4cb6d.tar.xz |
Merge branch 'fl/config'
* fl/config:
config: add support for --bool and --int while setting values
Diffstat (limited to 't/t1300-repo-config.sh')
-rwxr-xr-x | t/t1300-repo-config.sh | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 27486de4d..a2c11c463 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -471,11 +471,57 @@ test_expect_success bool ' done && cmp expect result' -test_expect_failure 'invalid bool' ' +test_expect_failure 'invalid bool (--get)' ' git-config bool.nobool foobar && git-config --bool --get bool.nobool' +test_expect_failure 'invalid bool (set)' ' + + git-config --bool bool.nobool foobar' + +rm .git/config + +cat > expect <<\EOF +[bool] + true1 = true + true2 = true + true3 = true + true4 = true + false1 = false + false2 = false + false3 = false + false4 = false +EOF + +test_expect_success 'set --bool' ' + + git-config --bool bool.true1 01 && + git-config --bool bool.true2 -1 && + git-config --bool bool.true3 YeS && + git-config --bool bool.true4 true && + git-config --bool bool.false1 000 && + git-config --bool bool.false2 "" && + git-config --bool bool.false3 nO && + git-config --bool bool.false4 FALSE && + cmp expect .git/config' + +rm .git/config + +cat > expect <<\EOF +[int] + val1 = 1 + val2 = -1 + val3 = 5242880 +EOF + +test_expect_success 'set --int' ' + + git-config --int int.val1 01 && + git-config --int int.val2 -1 && + git-config --int int.val3 5m && + cmp expect .git/config' + rm .git/config git-config quote.leading " test" |