summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2023-01-31 13:29:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-01-31 16:57:48 (GMT)
commitc93c3d2fa42bec64948441cb339d78e2044ff9a3 (patch)
tree8cf29470bf6343bcacfe862d7ba2ed31e7c16e1c /t
parent7bc73e7b61e60cbc0730a4f0e938c482c459e000 (diff)
downloadgit-c93c3d2fa42bec64948441cb339d78e2044ff9a3.zip
git-c93c3d2fa42bec64948441cb339d78e2044ff9a3.tar.gz
git-c93c3d2fa42bec64948441cb339d78e2044ff9a3.tar.bz2
bundle-uri: parse bundle.heuristic=creationToken
The bundle.heuristic value communicates that the bundle list is organized to make use of the bundle.<id>.creationToken values that may be provided in the bundle list. Those values will create a total order on the bundles, allowing the Git client to download them in a specific order and even remember previously-downloaded bundles by storing the maximum creation token value. Before implementing any logic that parses or uses the bundle.<id>.creationToken values, teach Git to parse the bundle.heuristic value from a bundle list. We can use 'test-tool bundle-uri' to print the heuristic value and verify that the parsing works correctly. As an extra precaution, create the internal 'heuristics' array to be a list of (enum, string) pairs so we can iterate through the array entries carefully, regardless of the enum values. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5750-bundle-uri-parse.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t5750-bundle-uri-parse.sh b/t/t5750-bundle-uri-parse.sh
index 7b4f930..6fc92a9 100755
--- a/t/t5750-bundle-uri-parse.sh
+++ b/t/t5750-bundle-uri-parse.sh
@@ -250,4 +250,23 @@ test_expect_success 'parse config format edge cases: empty key or value' '
test_cmp_config_output expect actual
'
+test_expect_success 'parse config format: creationToken heuristic' '
+ cat >expect <<-\EOF &&
+ [bundle]
+ version = 1
+ mode = all
+ heuristic = creationToken
+ [bundle "one"]
+ uri = http://example.com/bundle.bdl
+ [bundle "two"]
+ uri = https://example.com/bundle.bdl
+ [bundle "three"]
+ uri = file:///usr/share/git/bundle.bdl
+ EOF
+
+ test-tool bundle-uri parse-config expect >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp_config_output expect actual
+'
+
test_done