File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -364,4 +364,21 @@ test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' '
364
364
test_must_fail git rev-parse --verify broken
365
365
'
366
366
367
+ test_expect_success ' log diagnoses bogus HEAD hash' '
368
+ git init empty &&
369
+ test_when_finished "rm -rf empty" &&
370
+ echo 1234abcd >empty/.git/refs/heads/main &&
371
+ test_must_fail git -C empty log 2>stderr &&
372
+ test_grep broken stderr
373
+ '
374
+
375
+ test_expect_success ' log diagnoses bogus HEAD symref' '
376
+ git init empty &&
377
+ test-tool -C empty ref-store main create-symref HEAD refs/heads/invalid.lock &&
378
+ test_must_fail git -C empty log 2>stderr &&
379
+ test_grep broken stderr &&
380
+ test_must_fail git -C empty log --default totally-bogus 2>stderr &&
381
+ test_grep broken stderr
382
+ '
383
+
367
384
test_done
Original file line number Diff line number Diff line change @@ -2255,23 +2255,6 @@ test_expect_success 'log on empty repo fails' '
2255
2255
test_grep does.not.have.any.commits stderr
2256
2256
'
2257
2257
2258
- test_expect_success REFFILES ' log diagnoses bogus HEAD hash' '
2259
- git init empty &&
2260
- test_when_finished "rm -rf empty" &&
2261
- echo 1234abcd >empty/.git/refs/heads/main &&
2262
- test_must_fail git -C empty log 2>stderr &&
2263
- test_grep broken stderr
2264
- '
2265
-
2266
- test_expect_success REFFILES ' log diagnoses bogus HEAD symref' '
2267
- git init empty &&
2268
- test-tool -C empty ref-store main create-symref HEAD refs/heads/invalid.lock &&
2269
- test_must_fail git -C empty log 2>stderr &&
2270
- test_grep broken stderr &&
2271
- test_must_fail git -C empty log --default totally-bogus 2>stderr &&
2272
- test_grep broken stderr
2273
- '
2274
-
2275
2258
test_expect_success ' log does not default to HEAD when rev input is given' '
2276
2259
git log --branches=does-not-exist >actual &&
2277
2260
test_must_be_empty actual
You can’t perform that action at this time.
0 commit comments