[v2,18/22] t5703: make test work with SHA-256
diff mbox series

Message ID 20200125230035.136348-21-sandals@crustytoothpaste.net
State New
Headers show
Series
  • Untitled series #233347
Related show

Commit Message

brian m. carlson Jan. 25, 2020, 11 p.m. UTC
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Junio C Hamano Jan. 28, 2020, 7:09 p.m. UTC | #1
"brian m. carlson" <sandals@crustytoothpaste.net> writes:

> 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.

Has the above part been split into another patch?

> Furthermore, ensure we extract an object ID of the appropriate length
> using cut with fields instead of a fixed length.

This one makes sense.

> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
>  t/t5703-upload-pack-ref-in-want.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
> index 1424fabd4a..5511cdcec2 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 () {
brian m. carlson Jan. 29, 2020, 3:46 a.m. UTC | #2
On 2020-01-28 at 19:09:52, Junio C Hamano wrote:
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> 
> > 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.
> 
> Has the above part been split into another patch?

I think it has been.  I'll just squash them together, since it doesn't
really make sense to separate them out.

Patch
diff mbox series

diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index 1424fabd4a..5511cdcec2 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 () {