diff options
author | Derrick Stolee <derrickstolee@github.com> | 2023-01-31 14:29:12 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-01-31 17:57:48 +0100 |
commit | c93c3d2fa42bec64948441cb339d78e2044ff9a3 (patch) | |
tree | 8cf29470bf6343bcacfe862d7ba2ed31e7c16e1c /t/t5750-bundle-uri-parse.sh | |
parent | t5558: add tests for creationToken heuristic (diff) | |
download | git-c93c3d2fa42bec64948441cb339d78e2044ff9a3.tar.xz git-c93c3d2fa42bec64948441cb339d78e2044ff9a3.zip |
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 '')
-rwxr-xr-x | t/t5750-bundle-uri-parse.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t5750-bundle-uri-parse.sh b/t/t5750-bundle-uri-parse.sh index 7b4f930e53..6fc92a9c0d 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 |