about summary refs log tree commit diff
path: root/third_party/git/t/t5530-upload-pack-error.sh
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-25T23·06+0100
committerVincent Ambo <tazjin@google.com>2020-05-25T23·06+0100
commit93ba78d6f4632ef1c5228965e3edc8c0faf88c1e (patch)
tree85730c182a9f5f492ade8e8ccdb1c2356f9900bd /third_party/git/t/t5530-upload-pack-error.sh
parent6f8fbf4aa4b1654ab27d4829e114538761817de0 (diff)
revert(3p/git): Revert merge of git upstream at v2.26.2 r/852
This causes cgit to serve error pages, which is undesirable.

This reverts commit 5229c9b232de5bfa959ad6ebbb4c8192ac513352, reversing
changes made to f2b211131f2347342dde63975b09cf603149f1a3.
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