summaryrefslogtreecommitdiffstats
path: root/t/t5750-bundle-uri-parse.sh
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2023-01-31 14:29:13 +0100
committerJunio C Hamano <gitster@pobox.com>2023-01-31 17:57:48 +0100
commit512fccf8a503bd8617fe46cb62c77480b83fbaea (patch)
tree0a9357389668dcf3422c38c133ed6991abbba6ae /t/t5750-bundle-uri-parse.sh
parentbundle-uri: parse bundle.heuristic=creationToken (diff)
downloadgit-512fccf8a503bd8617fe46cb62c77480b83fbaea.tar.xz
git-512fccf8a503bd8617fe46cb62c77480b83fbaea.zip
bundle-uri: parse bundle.<id>.creationToken values
The previous change taught Git to parse the bundle.heuristic value, especially when its value is "creationToken". Now, teach Git to parse the bundle.<id>.creationToken values on each bundle in a bundle list. Before implementing any logic based on creationToken values for the creationToken heuristic, parse and print these values for testing purposes. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rwxr-xr-xt/t5750-bundle-uri-parse.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t5750-bundle-uri-parse.sh b/t/t5750-bundle-uri-parse.sh
index 6fc92a9c0d..81bdf58b94 100755
--- a/t/t5750-bundle-uri-parse.sh
+++ b/t/t5750-bundle-uri-parse.sh
@@ -258,10 +258,13 @@ test_expect_success 'parse config format: creationToken heuristic' '
heuristic = creationToken
[bundle "one"]
uri = http://example.com/bundle.bdl
+ creationToken = 123456
[bundle "two"]
uri = https://example.com/bundle.bdl
+ creationToken = 12345678901234567890
[bundle "three"]
uri = file:///usr/share/git/bundle.bdl
+ creationToken = 1
EOF
test-tool bundle-uri parse-config expect >actual 2>err &&
@@ -269,4 +272,19 @@ test_expect_success 'parse config format: creationToken heuristic' '
test_cmp_config_output expect actual
'
+test_expect_success 'parse config format edge cases: creationToken heuristic' '
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+ [bundle "one"]
+ uri = http://example.com/bundle.bdl
+ creationToken = bogus
+ EOF
+
+ test-tool bundle-uri parse-config expect >actual 2>err &&
+ grep "could not parse bundle list key creationToken with value '\''bogus'\''" err
+'
+
test_done