@@ -4,8 +4,6 @@ test_description='errors in upload-pack'
4
4
5
5
. ./test-lib.sh
6
6
7
- D=$( pwd)
8
-
9
7
corrupt_repo () {
10
8
object_sha1=$( git rev-parse " $1 " ) &&
11
9
ob=$( expr " $object_sha1 " : " \(..\)" ) &&
@@ -21,11 +19,7 @@ test_expect_success 'setup and corrupt repository' '
21
19
test_tick &&
22
20
echo changed >file &&
23
21
git commit -a -m changed &&
24
- corrupt_repo HEAD:file
25
-
26
- '
27
-
28
- test_expect_success ' fsck fails' '
22
+ corrupt_repo HEAD:file &&
29
23
test_must_fail git fsck
30
24
'
31
25
@@ -40,17 +34,12 @@ test_expect_success 'upload-pack fails due to error in pack-objects packing' '
40
34
'
41
35
42
36
test_expect_success ' corrupt repo differently' '
43
-
44
37
git hash-object -w file &&
45
- corrupt_repo HEAD^^{tree}
46
-
47
- '
48
-
49
- test_expect_success ' fsck fails' '
38
+ corrupt_repo HEAD^^{tree} &&
50
39
test_must_fail git fsck
51
40
'
52
- test_expect_success ' upload-pack fails due to error in rev-list' '
53
41
42
+ test_expect_success ' upload-pack fails due to error in rev-list' '
54
43
printf "%04xwant %s\n%04xshallow %s00000009done\n0000" \
55
44
$(($hexsz + 10)) $(git rev-parse HEAD) \
56
45
$(($hexsz + 12)) $(git rev-parse HEAD^) >input &&
@@ -59,7 +48,6 @@ test_expect_success 'upload-pack fails due to error in rev-list' '
59
48
'
60
49
61
50
test_expect_success ' upload-pack fails due to bad want (no object)' '
62
-
63
51
printf "%04xwant %s multi_ack_detailed\n00000009done\n0000" \
64
52
$(($hexsz + 29)) $(test_oid deadbeef) >input &&
65
53
test_must_fail git upload-pack . <input >output 2>output.err &&
@@ -69,7 +57,6 @@ test_expect_success 'upload-pack fails due to bad want (no object)' '
69
57
'
70
58
71
59
test_expect_success ' upload-pack fails due to bad want (not tip)' '
72
-
73
60
oid=$(echo an object we have | git hash-object -w --stdin) &&
74
61
printf "%04xwant %s multi_ack_detailed\n00000009done\n0000" \
75
62
$(($hexsz + 29)) "$oid" >input &&
@@ -80,7 +67,6 @@ test_expect_success 'upload-pack fails due to bad want (not tip)' '
80
67
'
81
68
82
69
test_expect_success ' upload-pack fails due to error in pack-objects enumeration' '
83
-
84
70
printf "%04xwant %s\n00000009done\n0000" \
85
71
$((hexsz + 10)) $(git rev-parse HEAD) >input &&
86
72
test_must_fail git upload-pack . <input >/dev/null 2>output.err &&
@@ -105,18 +91,9 @@ test_expect_success 'upload-pack tolerates EOF just after stateless client wants
105
91
test_cmp expect actual
106
92
'
107
93
108
- test_expect_success ' create empty repository' '
109
-
110
- mkdir foo &&
111
- cd foo &&
112
- git init
113
-
114
- '
115
-
116
94
test_expect_success ' fetch fails' '
117
-
118
- test_must_fail git fetch .. main
119
-
95
+ git init foo &&
96
+ test_must_fail git -C foo fetch .. main
120
97
'
121
98
122
99
test_done
0 commit comments