diff options
| author | brian m. carlson <sandals@crustytoothpaste.net> | 2019-12-21 19:49:32 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2020-01-15 14:06:19 -0800 |
| commit | a8c17e3bd6086bf3ed5c73fe610fc347ae494383 (patch) | |
| tree | 6476264e9187396c8547ff576125e73b86fc23e2 | |
| parent | 832072219cf9f2607ac1a509510fc65cd2fe0e06 (diff) | |
| download | git-a8c17e3bd6086bf3ed5c73fe610fc347ae494383.tar.gz | |
t5537: make hash size independent
This test modifies a pkt-line stream with sed to change a line with
"shallow" to "unshallow". However, this modification is dependent on
the size of the hash in use; with SHA-256, the pkt-line length is
different, leading to the sed command having no effect.
Use test_oid_cache to specify the correct values for each hash so that
the test continues to work.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rwxr-xr-x | t/t5537-fetch-shallow.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh index 97a67728ca..9e16512fe3 100755 --- a/t/t5537-fetch-shallow.sh +++ b/t/t5537-fetch-shallow.sh @@ -15,7 +15,11 @@ test_expect_success 'setup' ' commit 2 && commit 3 && commit 4 && - git config --global transfer.fsckObjects true + git config --global transfer.fsckObjects true && + test_oid_cache <<-EOF + sed sha1:s/0034shallow %s/0036unshallow %s/ + sed sha256:s/004cshallow %s/004eunshallow %s/ + EOF ' test_expect_success 'setup shallow clone' ' @@ -239,7 +243,7 @@ test_expect_success 'shallow fetches check connectivity before writing shallow f # with an empty packfile. This is done by refetching with a shorter # depth (to ensure that the packfile is empty), and overwriting the # shallow line in the response with the unshallow line we want. - printf "s/0034shallow %s/0036unshallow %s/" \ + printf "$(test_oid sed)" \ "$(git -C "$REPO" rev-parse HEAD)" \ "$(git -C "$REPO" rev-parse HEAD^)" \ >"$HTTPD_ROOT_PATH/one-time-sed" && |
