summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFrank Lichtenheld <frank@lichtenheld.de>2007-06-25 16:00:24 +0200
committerJunio C Hamano <gitster@pobox.com>2007-06-26 23:16:17 -0700
commitdb1696b8ab1d1bde67e78c773c58d837fa8b5e70 (patch)
tree4c20412285d13550e0972b8024e42546c1b05c30 /t
parent9cc0589ae85b782534b893faedc6a482fd9905ea (diff)
downloadgit-db1696b8ab1d1bde67e78c773c58d837fa8b5e70.tar.gz
config: add support for --bool and --int while setting values
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t1300-repo-config.sh48
-rwxr-xr-xt/t9400-git-cvsserver-server.sh4
2 files changed, 49 insertions, 3 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 7a77bef4c0..9443b875e2 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"
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 0331770686..641303e0a1 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -38,7 +38,7 @@ echo >empty &&
git commit -q -m "First Commit" &&
git clone -q --local --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
- GIT_DIR="$SERVERDIR" git config --bool gitcvs.logfile "$SERVERDIR/gitcvs.log" ||
+ GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" ||
exit 1
# note that cvs doesn't accept absolute pathnames
@@ -255,7 +255,7 @@ rm -fr "$SERVERDIR"
cd "$WORKDIR" &&
git clone -q --local --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
-GIT_DIR="$SERVERDIR" git config --bool gitcvs.logfile "$SERVERDIR/gitcvs.log" ||
+GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" ||
exit 1
test_expect_success 'cvs update (create new file)' \