about summary refs log tree commit diff
path: root/third_party/git/t/t5530-upload-pack-error.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/git/t/t5530-upload-pack-error.sh')
-rwxr-xr-xthird_party/git/t/t5530-upload-pack-error.sh26
1 files changed, 12 insertions, 14 deletions
diff --git a/third_party/git/t/t5530-upload-pack-error.sh b/third_party/git/t/t5530-upload-pack-error.sh
index 4ce9a9f70411..a1d3031d40dc 100755
--- a/third_party/git/t/t5530-upload-pack-error.sh
+++ b/third_party/git/t/t5530-upload-pack-error.sh
@@ -14,7 +14,7 @@ corrupt_repo () {
 }
 
 test_expect_success 'setup and corrupt repository' '
-	test_oid_init &&
+
 	echo file >file &&
 	git add file &&
 	git rev-parse :file &&
@@ -31,10 +31,9 @@ test_expect_success 'fsck fails' '
 '
 
 test_expect_success 'upload-pack fails due to error in pack-objects packing' '
-	head=$(git rev-parse HEAD) &&
-	hexsz=$(test_oid hexsz) &&
-	printf "%04xwant %s\n00000009done\n0000" \
-		$(($hexsz + 10)) $head >input &&
+
+	printf "0032want %s\n00000009done\n0000" \
+		$(git rev-parse HEAD) >input &&
 	test_must_fail git upload-pack . <input >/dev/null 2>output.err &&
 	test_i18ngrep "unable to read" output.err &&
 	test_i18ngrep "pack-objects died" output.err
@@ -52,17 +51,16 @@ test_expect_success 'fsck fails' '
 '
 test_expect_success 'upload-pack fails due to error in rev-list' '
 
-	printf "%04xwant %s\n%04xshallow %s00000009done\n0000" \
-		$(($hexsz + 10)) $(git rev-parse HEAD) \
-		$(($hexsz + 12)) $(git rev-parse HEAD^) >input &&
+	printf "0032want %s\n0034shallow %s00000009done\n0000" \
+		$(git rev-parse HEAD) $(git rev-parse HEAD^) >input &&
 	test_must_fail git upload-pack . <input >/dev/null 2>output.err &&
 	grep "bad tree object" output.err
 '
 
 test_expect_success 'upload-pack fails due to bad want (no object)' '
 
-	printf "%04xwant %s multi_ack_detailed\n00000009done\n0000" \
-		$(($hexsz + 29)) $(test_oid deadbeef) >input &&
+	printf "0045want %s multi_ack_detailed\n00000009done\n0000" \
+		"deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" >input &&
 	test_must_fail git upload-pack . <input >output 2>output.err &&
 	grep "not our ref" output.err &&
 	grep "ERR" output &&
@@ -72,8 +70,8 @@ test_expect_success 'upload-pack fails due to bad want (no object)' '
 test_expect_success 'upload-pack fails due to bad want (not tip)' '
 
 	oid=$(echo an object we have | git hash-object -w --stdin) &&
-	printf "%04xwant %s multi_ack_detailed\n00000009done\n0000" \
-		$(($hexsz + 29)) "$oid" >input &&
+	printf "0045want %s multi_ack_detailed\n00000009done\n0000" \
+		"$oid" >input &&
 	test_must_fail git upload-pack . <input >output 2>output.err &&
 	grep "not our ref" output.err &&
 	grep "ERR" output &&
@@ -82,8 +80,8 @@ test_expect_success 'upload-pack fails due to bad want (not tip)' '
 
 test_expect_success 'upload-pack fails due to error in pack-objects enumeration' '
 
-	printf "%04xwant %s\n00000009done\n0000" \
-		$((hexsz + 10)) $(git rev-parse HEAD) >input &&
+	printf "0032want %s\n00000009done\n0000" \
+		$(git rev-parse HEAD) >input &&
 	test_must_fail git upload-pack . <input >/dev/null 2>output.err &&
 	grep "bad tree object" output.err &&
 	grep "pack-objects died" output.err