summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-09-12 14:41:00 -0700
committerJunio C Hamano <gitster@pobox.com>2013-09-12 14:41:00 -0700
commitc7c377d83f46113233718eaeb9009e7e6242b03d (patch)
tree3bc9fc1badb48ac73f19fae949a72575c513ecc0 /t
parenta194eaddca201163aa756faccd519f056bd3c35e (diff)
parent00160242770aea137ec7154a8e8406feef733926 (diff)
downloadgit-c7c377d83f46113233718eaeb9009e7e6242b03d.tar.gz
Merge branch 'jk/config-int-range-check'
"git config" did not provide a way to set or access numbers larger than a native "int" on the platform; it now provides 64-bit signed integers on all platforms. * jk/config-int-range-check: git-config: always treat --int as 64-bit internally config: make numeric parsing errors more clear config: set errno in numeric git_parse_* functions config: properly range-check integer values config: factor out integer parsing from range checks
Diffstat (limited to 't')
-rwxr-xr-xt/t1300-repo-config.sh13
-rwxr-xr-xt/t4055-diff-context.sh2
2 files changed, 11 insertions, 4 deletions
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index c23f4781e1..967359344d 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -652,16 +652,23 @@ test_expect_success numbers '
test_cmp expect actual
'
+test_expect_success '--int is at least 64 bits' '
+ git config giga.watts 121g &&
+ echo 129922760704 >expect &&
+ git config --int --get giga.watts >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'invalid unit' '
git config aninvalid.unit "1auto" &&
echo 1auto >expect &&
git config aninvalid.unit >actual &&
test_cmp expect actual &&
- cat > expect <<-\EOF
- fatal: bad config value for '\''aninvalid.unit'\'' in .git/config
+ cat >expect <<-\EOF
+ fatal: bad numeric config value '\''1auto'\'' for '\''aninvalid.unit'\'' in .git/config: invalid unit
EOF
test_must_fail git config --int --get aninvalid.unit 2>actual &&
- test_cmp actual expect
+ test_i18ncmp expect actual
'
cat > expect << EOF
diff --git a/t/t4055-diff-context.sh b/t/t4055-diff-context.sh
index 97172b46b2..cd0454356a 100755
--- a/t/t4055-diff-context.sh
+++ b/t/t4055-diff-context.sh
@@ -73,7 +73,7 @@ test_expect_success 'plumbing not affected' '
test_expect_success 'non-integer config parsing' '
git config diff.context no &&
test_must_fail git diff 2>output &&
- test_i18ngrep "bad config value" output
+ test_i18ngrep "bad numeric config value" output
'
test_expect_success 'negative integer config parsing' '