[PATCH 20/24] t5703: make test work with SHA-256
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Jan 13, 2020, 12:38 UTC
- Message-ID
- <20200113123857.3684632-21-sandals@crustytoothpaste.net>
- In-Reply-To
- <20200113123857.3684632-1-sandals@crustytoothpaste.net>
This test used an object ID which was 40 hex characters in length, causing the test not only not to pass, but to hang, when run with SHA-256 as the hash. Change this value to a fixed dummy object ID using test_oid_init and test_oid.
Furthermore, ensure we extract an object ID of the appropriate length using cut with fields instead of a fixed length.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> --- t/t5703-upload-pack-ref-in-want.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh index 1424fabd4a..852c01ecb4 100755 --- a/t/t5703-upload-pack-ref-in-want.sh +++ b/t/t5703-upload-pack-ref-in-want.sh @@ -19,7 +19,7 @@ get_actual_commits () { }' <out | test-tool pkt-line unpack-sideband >o.pack && git index-pack o.pack && git verify-pack -v o.idx >objs && - grep commit objs | cut -c-40 | sort >actual_commits + grep commit objs | cut -d" " -f1 | sort >actual_commits } check_output () { @@ -37,6 +37,7 @@ check_output () { # \ | / # a test_expect_success 'setup repository' ' + test_oid_init && test_commit a && git checkout -b o/foo && test_commit b &&