Git fork

t: convert some here-doc test bodies

The t1404 script checks a lot of output from Git which contains single
quotes. Because the test snippets are themselves wrapped in the same
single-quotes, we have to resort to using $SQ to match them. This is
error-prone and makes the tests harder to read.

Instead, let's use the new here-doc feature added in the previous
commit, which lets us write anything in the test body we want (except
the here-doc end marker on a line by itself, of course).

Note that we do use "\" in our marker to avoid interpolation (which is
the whole point). But we don't use "<<-", as we want to preserve
whitespace in the snippet (and running with "-v" before and after shows
that we produce the exact same output, except with the ugly $SQ
references fixed).

I just converted every test here, even though only some of them use
$SQ. But it would be equally correct to mix-and-match styles if we don't
mind the inconsistency.

I've also converted a few tests in t0600 which were moved from t1404 (I
had written this patch before they were moved, but it seemed worth
porting over the changes rather than losing them).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Jeff King and committed by
Junio C Hamano
f6b75726 1d133ae9

+117 -117
+19 -19
t/t0600-reffiles-backend.sh
··· 91 91 git update-ref --stdin 92 92 ' 93 93 94 - test_expect_success 'non-empty directory blocks create' ' 94 + test_expect_success 'non-empty directory blocks create' - <<\EOT 95 95 prefix=refs/ne-create && 96 96 mkdir -p .git/$prefix/foo/bar && 97 97 : >.git/$prefix/foo/bar/baz.lock && 98 98 test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" && 99 99 cat >expected <<-EOF && 100 - fatal: cannot lock ref $SQ$prefix/foo$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ 100 + fatal: cannot lock ref '$prefix/foo': there is a non-empty directory '.git/$prefix/foo' blocking reference '$prefix/foo' 101 101 EOF 102 102 printf "%s\n" "update $prefix/foo $C" | 103 103 test_must_fail git update-ref --stdin 2>output.err && 104 104 test_cmp expected output.err && 105 105 cat >expected <<-EOF && 106 - fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ 106 + fatal: cannot lock ref '$prefix/foo': unable to resolve reference '$prefix/foo' 107 107 EOF 108 108 printf "%s\n" "update $prefix/foo $D $C" | 109 109 test_must_fail git update-ref --stdin 2>output.err && 110 110 test_cmp expected output.err 111 - ' 111 + EOT 112 112 113 - test_expect_success 'broken reference blocks create' ' 113 + test_expect_success 'broken reference blocks create' - <<\EOT 114 114 prefix=refs/broken-create && 115 115 mkdir -p .git/$prefix && 116 116 echo "gobbledigook" >.git/$prefix/foo && 117 117 test_when_finished "rm -f .git/$prefix/foo" && 118 118 cat >expected <<-EOF && 119 - fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken 119 + fatal: cannot lock ref '$prefix/foo': unable to resolve reference '$prefix/foo': reference broken 120 120 EOF 121 121 printf "%s\n" "update $prefix/foo $C" | 122 122 test_must_fail git update-ref --stdin 2>output.err && 123 123 test_cmp expected output.err && 124 124 cat >expected <<-EOF && 125 - fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken 125 + fatal: cannot lock ref '$prefix/foo': unable to resolve reference '$prefix/foo': reference broken 126 126 EOF 127 127 printf "%s\n" "update $prefix/foo $D $C" | 128 128 test_must_fail git update-ref --stdin 2>output.err && 129 129 test_cmp expected output.err 130 - ' 130 + EOT 131 131 132 - test_expect_success 'non-empty directory blocks indirect create' ' 132 + test_expect_success 'non-empty directory blocks indirect create' - <<\EOT 133 133 prefix=refs/ne-indirect-create && 134 134 git symbolic-ref $prefix/symref $prefix/foo && 135 135 mkdir -p .git/$prefix/foo/bar && 136 136 : >.git/$prefix/foo/bar/baz.lock && 137 137 test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" && 138 138 cat >expected <<-EOF && 139 - fatal: cannot lock ref $SQ$prefix/symref$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ 139 + fatal: cannot lock ref '$prefix/symref': there is a non-empty directory '.git/$prefix/foo' blocking reference '$prefix/foo' 140 140 EOF 141 141 printf "%s\n" "update $prefix/symref $C" | 142 142 test_must_fail git update-ref --stdin 2>output.err && 143 143 test_cmp expected output.err && 144 144 cat >expected <<-EOF && 145 - fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ 145 + fatal: cannot lock ref '$prefix/symref': unable to resolve reference '$prefix/foo' 146 146 EOF 147 147 printf "%s\n" "update $prefix/symref $D $C" | 148 148 test_must_fail git update-ref --stdin 2>output.err && 149 149 test_cmp expected output.err 150 - ' 150 + EOT 151 151 152 - test_expect_success 'broken reference blocks indirect create' ' 152 + test_expect_success 'broken reference blocks indirect create' - <<\EOT 153 153 prefix=refs/broken-indirect-create && 154 154 git symbolic-ref $prefix/symref $prefix/foo && 155 155 echo "gobbledigook" >.git/$prefix/foo && 156 156 test_when_finished "rm -f .git/$prefix/foo" && 157 157 cat >expected <<-EOF && 158 - fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken 158 + fatal: cannot lock ref '$prefix/symref': unable to resolve reference '$prefix/foo': reference broken 159 159 EOF 160 160 printf "%s\n" "update $prefix/symref $C" | 161 161 test_must_fail git update-ref --stdin 2>output.err && 162 162 test_cmp expected output.err && 163 163 cat >expected <<-EOF && 164 - fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken 164 + fatal: cannot lock ref '$prefix/symref': unable to resolve reference '$prefix/foo': reference broken 165 165 EOF 166 166 printf "%s\n" "update $prefix/symref $D $C" | 167 167 test_must_fail git update-ref --stdin 2>output.err && 168 168 test_cmp expected output.err 169 - ' 169 + EOT 170 170 171 171 test_expect_success 'no bogus intermediate values during delete' ' 172 172 prefix=refs/slow-transaction && ··· 224 224 test_must_fail git rev-parse --verify --quiet $prefix/foo 225 225 ' 226 226 227 - test_expect_success 'delete fails cleanly if packed-refs file is locked' ' 227 + test_expect_success 'delete fails cleanly if packed-refs file is locked' - <<\EOT 228 228 prefix=refs/locked-packed-refs && 229 229 # Set up a reference with differing loose and packed versions: 230 230 git update-ref $prefix/foo $C && ··· 236 236 test_when_finished "rm -f .git/packed-refs.lock" && 237 237 test_must_fail git update-ref -d $prefix/foo >out 2>err && 238 238 git for-each-ref $prefix >actual && 239 - test_grep "Unable to create $SQ.*packed-refs.lock$SQ: " err && 239 + test_grep "Unable to create '.*packed-refs.lock': " err && 240 240 test_cmp unchanged actual 241 - ' 241 + EOT 242 242 243 243 test_expect_success 'delete fails cleanly if packed-refs.new write fails' ' 244 244 # Setup and expectations are similar to the test above.
+98 -98
t/t1404-update-ref-errors.sh
··· 100 100 printf "%s\n" "delete $delname" "create $addname $D" 101 101 fi >commands && 102 102 test_must_fail git update-ref --stdin <commands 2>output.err && 103 - grep -E "fatal:( cannot lock ref $SQ$addname$SQ:)? $SQ$delref$SQ exists; cannot create $SQ$addref$SQ" output.err && 103 + grep -E "fatal:( cannot lock ref '$addname':)? '$delref' exists; cannot create '$addref'" output.err && 104 104 printf "%s\n" "$C $delref" >expected-refs && 105 105 git for-each-ref --format="%(objectname) %(refname)" $prefix/r >actual-refs && 106 106 test_cmp expected-refs actual-refs 107 107 } 108 108 109 - test_expect_success 'setup' ' 109 + test_expect_success 'setup' - <<\EOT 110 110 111 111 git commit --allow-empty -m Initial && 112 112 C=$(git rev-parse HEAD) && ··· 114 114 D=$(git rev-parse HEAD) && 115 115 git commit --allow-empty -m Third && 116 116 E=$(git rev-parse HEAD) 117 - ' 117 + EOT 118 118 119 - test_expect_success 'existing loose ref is a simple prefix of new' ' 119 + test_expect_success 'existing loose ref is a simple prefix of new' - <<\EOT 120 120 121 121 prefix=refs/1l && 122 122 test_update_rejected "a c e" false "b c/x d" \ 123 - "$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x$SQ" 123 + "'$prefix/c' exists; cannot create '$prefix/c/x'" 124 124 125 - ' 125 + EOT 126 126 127 - test_expect_success 'existing packed ref is a simple prefix of new' ' 127 + test_expect_success 'existing packed ref is a simple prefix of new' - <<\EOT 128 128 129 129 prefix=refs/1p && 130 130 test_update_rejected "a c e" true "b c/x d" \ 131 - "$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x$SQ" 131 + "'$prefix/c' exists; cannot create '$prefix/c/x'" 132 132 133 - ' 133 + EOT 134 134 135 - test_expect_success 'existing loose ref is a deeper prefix of new' ' 135 + test_expect_success 'existing loose ref is a deeper prefix of new' - <<\EOT 136 136 137 137 prefix=refs/2l && 138 138 test_update_rejected "a c e" false "b c/x/y d" \ 139 - "$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x/y$SQ" 139 + "'$prefix/c' exists; cannot create '$prefix/c/x/y'" 140 140 141 - ' 141 + EOT 142 142 143 - test_expect_success 'existing packed ref is a deeper prefix of new' ' 143 + test_expect_success 'existing packed ref is a deeper prefix of new' - <<\EOT 144 144 145 145 prefix=refs/2p && 146 146 test_update_rejected "a c e" true "b c/x/y d" \ 147 - "$SQ$prefix/c$SQ exists; cannot create $SQ$prefix/c/x/y$SQ" 147 + "'$prefix/c' exists; cannot create '$prefix/c/x/y'" 148 148 149 - ' 149 + EOT 150 150 151 - test_expect_success 'new ref is a simple prefix of existing loose' ' 151 + test_expect_success 'new ref is a simple prefix of existing loose' - <<\EOT 152 152 153 153 prefix=refs/3l && 154 154 test_update_rejected "a c/x e" false "b c d" \ 155 - "$SQ$prefix/c/x$SQ exists; cannot create $SQ$prefix/c$SQ" 155 + "'$prefix/c/x' exists; cannot create '$prefix/c'" 156 156 157 - ' 157 + EOT 158 158 159 - test_expect_success 'new ref is a simple prefix of existing packed' ' 159 + test_expect_success 'new ref is a simple prefix of existing packed' - <<\EOT 160 160 161 161 prefix=refs/3p && 162 162 test_update_rejected "a c/x e" true "b c d" \ 163 - "$SQ$prefix/c/x$SQ exists; cannot create $SQ$prefix/c$SQ" 163 + "'$prefix/c/x' exists; cannot create '$prefix/c'" 164 164 165 - ' 165 + EOT 166 166 167 - test_expect_success 'new ref is a deeper prefix of existing loose' ' 167 + test_expect_success 'new ref is a deeper prefix of existing loose' - <<\EOT 168 168 169 169 prefix=refs/4l && 170 170 test_update_rejected "a c/x/y e" false "b c d" \ 171 - "$SQ$prefix/c/x/y$SQ exists; cannot create $SQ$prefix/c$SQ" 171 + "'$prefix/c/x/y' exists; cannot create '$prefix/c'" 172 172 173 - ' 173 + EOT 174 174 175 - test_expect_success 'new ref is a deeper prefix of existing packed' ' 175 + test_expect_success 'new ref is a deeper prefix of existing packed' - <<\EOT 176 176 177 177 prefix=refs/4p && 178 178 test_update_rejected "a c/x/y e" true "b c d" \ 179 - "$SQ$prefix/c/x/y$SQ exists; cannot create $SQ$prefix/c$SQ" 179 + "'$prefix/c/x/y' exists; cannot create '$prefix/c'" 180 180 181 - ' 181 + EOT 182 182 183 - test_expect_success 'one new ref is a simple prefix of another' ' 183 + test_expect_success 'one new ref is a simple prefix of another' - <<\EOT 184 184 185 185 prefix=refs/5 && 186 186 test_update_rejected "a e" false "b c c/x d" \ 187 - "cannot process $SQ$prefix/c$SQ and $SQ$prefix/c/x$SQ at the same time" 187 + "cannot process '$prefix/c' and '$prefix/c/x' at the same time" 188 188 189 - ' 189 + EOT 190 190 191 - test_expect_success 'D/F conflict prevents add long + delete short' ' 191 + test_expect_success 'D/F conflict prevents add long + delete short' - <<\EOT 192 192 df_test refs/df-al-ds --add-del foo/bar foo 193 - ' 193 + EOT 194 194 195 - test_expect_success 'D/F conflict prevents add short + delete long' ' 195 + test_expect_success 'D/F conflict prevents add short + delete long' - <<\EOT 196 196 df_test refs/df-as-dl --add-del foo foo/bar 197 - ' 197 + EOT 198 198 199 - test_expect_success 'D/F conflict prevents delete long + add short' ' 199 + test_expect_success 'D/F conflict prevents delete long + add short' - <<\EOT 200 200 df_test refs/df-dl-as --del-add foo/bar foo 201 - ' 201 + EOT 202 202 203 - test_expect_success 'D/F conflict prevents delete short + add long' ' 203 + test_expect_success 'D/F conflict prevents delete short + add long' - <<\EOT 204 204 df_test refs/df-ds-al --del-add foo foo/bar 205 - ' 205 + EOT 206 206 207 - test_expect_success 'D/F conflict prevents add long + delete short packed' ' 207 + test_expect_success 'D/F conflict prevents add long + delete short packed' - <<\EOT 208 208 df_test refs/df-al-dsp --pack --add-del foo/bar foo 209 - ' 209 + EOT 210 210 211 - test_expect_success 'D/F conflict prevents add short + delete long packed' ' 211 + test_expect_success 'D/F conflict prevents add short + delete long packed' - <<\EOT 212 212 df_test refs/df-as-dlp --pack --add-del foo foo/bar 213 - ' 213 + EOT 214 214 215 - test_expect_success 'D/F conflict prevents delete long packed + add short' ' 215 + test_expect_success 'D/F conflict prevents delete long packed + add short' - <<\EOT 216 216 df_test refs/df-dlp-as --pack --del-add foo/bar foo 217 - ' 217 + EOT 218 218 219 - test_expect_success 'D/F conflict prevents delete short packed + add long' ' 219 + test_expect_success 'D/F conflict prevents delete short packed + add long' - <<\EOT 220 220 df_test refs/df-dsp-al --pack --del-add foo foo/bar 221 - ' 221 + EOT 222 222 223 223 # Try some combinations involving symbolic refs... 224 224 225 - test_expect_success 'D/F conflict prevents indirect add long + delete short' ' 225 + test_expect_success 'D/F conflict prevents indirect add long + delete short' - <<\EOT 226 226 df_test refs/df-ial-ds --sym-add --add-del foo/bar foo 227 - ' 227 + EOT 228 228 229 - test_expect_success 'D/F conflict prevents indirect add long + indirect delete short' ' 229 + test_expect_success 'D/F conflict prevents indirect add long + indirect delete short' - <<\EOT 230 230 df_test refs/df-ial-ids --sym-add --sym-del --add-del foo/bar foo 231 - ' 231 + EOT 232 232 233 - test_expect_success 'D/F conflict prevents indirect add short + indirect delete long' ' 233 + test_expect_success 'D/F conflict prevents indirect add short + indirect delete long' - <<\EOT 234 234 df_test refs/df-ias-idl --sym-add --sym-del --add-del foo foo/bar 235 - ' 235 + EOT 236 236 237 - test_expect_success 'D/F conflict prevents indirect delete long + indirect add short' ' 237 + test_expect_success 'D/F conflict prevents indirect delete long + indirect add short' - <<\EOT 238 238 df_test refs/df-idl-ias --sym-add --sym-del --del-add foo/bar foo 239 - ' 239 + EOT 240 240 241 - test_expect_success 'D/F conflict prevents indirect add long + delete short packed' ' 241 + test_expect_success 'D/F conflict prevents indirect add long + delete short packed' - <<\EOT 242 242 df_test refs/df-ial-dsp --sym-add --pack --add-del foo/bar foo 243 - ' 243 + EOT 244 244 245 - test_expect_success 'D/F conflict prevents indirect add long + indirect delete short packed' ' 245 + test_expect_success 'D/F conflict prevents indirect add long + indirect delete short packed' - <<\EOT 246 246 df_test refs/df-ial-idsp --sym-add --sym-del --pack --add-del foo/bar foo 247 - ' 247 + EOT 248 248 249 - test_expect_success 'D/F conflict prevents add long + indirect delete short packed' ' 249 + test_expect_success 'D/F conflict prevents add long + indirect delete short packed' - <<\EOT 250 250 df_test refs/df-al-idsp --sym-del --pack --add-del foo/bar foo 251 - ' 251 + EOT 252 252 253 - test_expect_success 'D/F conflict prevents indirect delete long packed + indirect add short' ' 253 + test_expect_success 'D/F conflict prevents indirect delete long packed + indirect add short' - <<\EOT 254 254 df_test refs/df-idlp-ias --sym-add --sym-del --pack --del-add foo/bar foo 255 - ' 255 + EOT 256 256 257 257 # Test various errors when reading the old values of references... 258 258 259 - test_expect_success 'missing old value blocks update' ' 259 + test_expect_success 'missing old value blocks update' - <<\EOT 260 260 prefix=refs/missing-update && 261 261 cat >expected <<-EOF && 262 - fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ 262 + fatal: cannot lock ref '$prefix/foo': unable to resolve reference '$prefix/foo' 263 263 EOF 264 264 printf "%s\n" "update $prefix/foo $E $D" | 265 265 test_must_fail git update-ref --stdin 2>output.err && 266 266 test_cmp expected output.err 267 - ' 267 + EOT 268 268 269 - test_expect_success 'incorrect old value blocks update' ' 269 + test_expect_success 'incorrect old value blocks update' - <<\EOT 270 270 prefix=refs/incorrect-update && 271 271 git update-ref $prefix/foo $C && 272 272 cat >expected <<-EOF && 273 - fatal: cannot lock ref $SQ$prefix/foo$SQ: is at $C but expected $D 273 + fatal: cannot lock ref '$prefix/foo': is at $C but expected $D 274 274 EOF 275 275 printf "%s\n" "update $prefix/foo $E $D" | 276 276 test_must_fail git update-ref --stdin 2>output.err && 277 277 test_cmp expected output.err 278 - ' 278 + EOT 279 279 280 - test_expect_success 'existing old value blocks create' ' 280 + test_expect_success 'existing old value blocks create' - <<\EOT 281 281 prefix=refs/existing-create && 282 282 git update-ref $prefix/foo $C && 283 283 cat >expected <<-EOF && 284 - fatal: cannot lock ref $SQ$prefix/foo$SQ: reference already exists 284 + fatal: cannot lock ref '$prefix/foo': reference already exists 285 285 EOF 286 286 printf "%s\n" "create $prefix/foo $E" | 287 287 test_must_fail git update-ref --stdin 2>output.err && 288 288 test_cmp expected output.err 289 - ' 289 + EOT 290 290 291 - test_expect_success 'incorrect old value blocks delete' ' 291 + test_expect_success 'incorrect old value blocks delete' - <<\EOT 292 292 prefix=refs/incorrect-delete && 293 293 git update-ref $prefix/foo $C && 294 294 cat >expected <<-EOF && 295 - fatal: cannot lock ref $SQ$prefix/foo$SQ: is at $C but expected $D 295 + fatal: cannot lock ref '$prefix/foo': is at $C but expected $D 296 296 EOF 297 297 printf "%s\n" "delete $prefix/foo $D" | 298 298 test_must_fail git update-ref --stdin 2>output.err && 299 299 test_cmp expected output.err 300 - ' 300 + EOT 301 301 302 - test_expect_success 'missing old value blocks indirect update' ' 302 + test_expect_success 'missing old value blocks indirect update' - <<\EOT 303 303 prefix=refs/missing-indirect-update && 304 304 git symbolic-ref $prefix/symref $prefix/foo && 305 305 cat >expected <<-EOF && 306 - fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ 306 + fatal: cannot lock ref '$prefix/symref': unable to resolve reference '$prefix/foo' 307 307 EOF 308 308 printf "%s\n" "update $prefix/symref $E $D" | 309 309 test_must_fail git update-ref --stdin 2>output.err && 310 310 test_cmp expected output.err 311 - ' 311 + EOT 312 312 313 - test_expect_success 'incorrect old value blocks indirect update' ' 313 + test_expect_success 'incorrect old value blocks indirect update' - <<\EOT 314 314 prefix=refs/incorrect-indirect-update && 315 315 git symbolic-ref $prefix/symref $prefix/foo && 316 316 git update-ref $prefix/foo $C && 317 317 cat >expected <<-EOF && 318 - fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D 318 + fatal: cannot lock ref '$prefix/symref': is at $C but expected $D 319 319 EOF 320 320 printf "%s\n" "update $prefix/symref $E $D" | 321 321 test_must_fail git update-ref --stdin 2>output.err && 322 322 test_cmp expected output.err 323 - ' 323 + EOT 324 324 325 - test_expect_success 'existing old value blocks indirect create' ' 325 + test_expect_success 'existing old value blocks indirect create' - <<\EOT 326 326 prefix=refs/existing-indirect-create && 327 327 git symbolic-ref $prefix/symref $prefix/foo && 328 328 git update-ref $prefix/foo $C && 329 329 cat >expected <<-EOF && 330 - fatal: cannot lock ref $SQ$prefix/symref$SQ: reference already exists 330 + fatal: cannot lock ref '$prefix/symref': reference already exists 331 331 EOF 332 332 printf "%s\n" "create $prefix/symref $E" | 333 333 test_must_fail git update-ref --stdin 2>output.err && 334 334 test_cmp expected output.err 335 - ' 335 + EOT 336 336 337 - test_expect_success 'incorrect old value blocks indirect delete' ' 337 + test_expect_success 'incorrect old value blocks indirect delete' - <<\EOT 338 338 prefix=refs/incorrect-indirect-delete && 339 339 git symbolic-ref $prefix/symref $prefix/foo && 340 340 git update-ref $prefix/foo $C && 341 341 cat >expected <<-EOF && 342 - fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D 342 + fatal: cannot lock ref '$prefix/symref': is at $C but expected $D 343 343 EOF 344 344 printf "%s\n" "delete $prefix/symref $D" | 345 345 test_must_fail git update-ref --stdin 2>output.err && 346 346 test_cmp expected output.err 347 - ' 347 + EOT 348 348 349 - test_expect_success 'missing old value blocks indirect no-deref update' ' 349 + test_expect_success 'missing old value blocks indirect no-deref update' - <<\EOT 350 350 prefix=refs/missing-noderef-update && 351 351 git symbolic-ref $prefix/symref $prefix/foo && 352 352 cat >expected <<-EOF && 353 - fatal: cannot lock ref $SQ$prefix/symref$SQ: reference is missing but expected $D 353 + fatal: cannot lock ref '$prefix/symref': reference is missing but expected $D 354 354 EOF 355 355 printf "%s\n" "option no-deref" "update $prefix/symref $E $D" | 356 356 test_must_fail git update-ref --stdin 2>output.err && 357 357 test_cmp expected output.err 358 - ' 358 + EOT 359 359 360 - test_expect_success 'incorrect old value blocks indirect no-deref update' ' 360 + test_expect_success 'incorrect old value blocks indirect no-deref update' - <<\EOT 361 361 prefix=refs/incorrect-noderef-update && 362 362 git symbolic-ref $prefix/symref $prefix/foo && 363 363 git update-ref $prefix/foo $C && 364 364 cat >expected <<-EOF && 365 - fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D 365 + fatal: cannot lock ref '$prefix/symref': is at $C but expected $D 366 366 EOF 367 367 printf "%s\n" "option no-deref" "update $prefix/symref $E $D" | 368 368 test_must_fail git update-ref --stdin 2>output.err && 369 369 test_cmp expected output.err 370 - ' 370 + EOT 371 371 372 - test_expect_success 'existing old value blocks indirect no-deref create' ' 372 + test_expect_success 'existing old value blocks indirect no-deref create' - <<\EOT 373 373 prefix=refs/existing-noderef-create && 374 374 git symbolic-ref $prefix/symref $prefix/foo && 375 375 git update-ref $prefix/foo $C && 376 376 cat >expected <<-EOF && 377 - fatal: cannot lock ref $SQ$prefix/symref$SQ: reference already exists 377 + fatal: cannot lock ref '$prefix/symref': reference already exists 378 378 EOF 379 379 printf "%s\n" "option no-deref" "create $prefix/symref $E" | 380 380 test_must_fail git update-ref --stdin 2>output.err && 381 381 test_cmp expected output.err 382 - ' 382 + EOT 383 383 384 - test_expect_success 'incorrect old value blocks indirect no-deref delete' ' 384 + test_expect_success 'incorrect old value blocks indirect no-deref delete' - <<\EOT 385 385 prefix=refs/incorrect-noderef-delete && 386 386 git symbolic-ref $prefix/symref $prefix/foo && 387 387 git update-ref $prefix/foo $C && 388 388 cat >expected <<-EOF && 389 - fatal: cannot lock ref $SQ$prefix/symref$SQ: is at $C but expected $D 389 + fatal: cannot lock ref '$prefix/symref': is at $C but expected $D 390 390 EOF 391 391 printf "%s\n" "option no-deref" "delete $prefix/symref $D" | 392 392 test_must_fail git update-ref --stdin 2>output.err && 393 393 test_cmp expected output.err 394 - ' 394 + EOT 395 395 396 396 test_done