summaryrefslogtreecommitdiff
path: root/t/t5703-upload-pack-ref-in-want.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-06-19 17:55:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-19 21:04:09 (GMT)
commitf7c6a3bf080aae499e0aa0c69aa0d86423bd24f8 (patch)
tree787421eafc6b31da99ebd9e19d131f5526e6b956 /t/t5703-upload-pack-ref-in-want.sh
parent8fc700354045ccf1eb3c10fe0f7d6cb2c6427628 (diff)
downloadgit-f7c6a3bf080aae499e0aa0c69aa0d86423bd24f8.zip
git-f7c6a3bf080aae499e0aa0c69aa0d86423bd24f8.tar.gz
git-f7c6a3bf080aae499e0aa0c69aa0d86423bd24f8.tar.bz2
t5703: use object-format serve option
When we're using an algorithm other than SHA-1, we need to specify the algorithm in use so we don't get a failure with an "unknown format" message. Add a wrapper function that specifies this header if required. Skip specifying this header for SHA-1 to test that it works both with an without this header. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5703-upload-pack-ref-in-want.sh')
-rwxr-xr-xt/t5703-upload-pack-ref-in-want.sh19
1 files changed, 14 insertions, 5 deletions
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index a34460f..afe7f7f 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -27,6 +27,15 @@ check_output () {
test_cmp sorted_commits actual_commits
}
+write_command () {
+ echo "command=$1"
+
+ if test "$(test_oid algo)" != sha1
+ then
+ echo "object-format=$(test_oid algo)"
+ fi
+}
+
# c(o/foo) d(o/bar)
# \ /
# b e(baz) f(master)
@@ -62,7 +71,7 @@ test_expect_success 'config controls ref-in-want advertisement' '
test_expect_success 'invalid want-ref line' '
test-tool pkt-line pack >in <<-EOF &&
- command=fetch
+ $(write_command fetch)
0001
no-progress
want-ref refs/heads/non-existent
@@ -83,7 +92,7 @@ test_expect_success 'basic want-ref' '
oid=$(git rev-parse a) &&
test-tool pkt-line pack >in <<-EOF &&
- command=fetch
+ $(write_command fetch)
0001
no-progress
want-ref refs/heads/master
@@ -107,7 +116,7 @@ test_expect_success 'multiple want-ref lines' '
oid=$(git rev-parse b) &&
test-tool pkt-line pack >in <<-EOF &&
- command=fetch
+ $(write_command fetch)
0001
no-progress
want-ref refs/heads/o/foo
@@ -129,7 +138,7 @@ test_expect_success 'mix want and want-ref' '
git rev-parse e f >expected_commits &&
test-tool pkt-line pack >in <<-EOF &&
- command=fetch
+ $(write_command fetch)
0001
no-progress
want-ref refs/heads/master
@@ -152,7 +161,7 @@ test_expect_success 'want-ref with ref we already have commit for' '
oid=$(git rev-parse c) &&
test-tool pkt-line pack >in <<-EOF &&
- command=fetch
+ $(write_command fetch)
0001
no-progress
want-ref refs/heads/o/foo