Skip to content

Commit 0b7de6c

Browse files
hanwengitster
authored andcommitted
t1400: use git rev-parse for testing PSEUDOREF existence
This will allow these tests to run with alternative ref backends Signed-off-by: Han-Wen Nienhuys <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 523fa69 commit 0b7de6c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

t/t1400-update-ref.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -475,57 +475,57 @@ test_expect_success 'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER
475475

476476
test_expect_success 'given old value for missing pseudoref, do not create' '
477477
test_must_fail git update-ref PSEUDOREF $A $B 2>err &&
478-
test_path_is_missing .git/PSEUDOREF &&
478+
test_must_fail git rev-parse PSEUDOREF &&
479479
test_i18ngrep "could not read ref" err
480480
'
481481

482482
test_expect_success 'create pseudoref' '
483483
git update-ref PSEUDOREF $A &&
484-
test $A = $(cat .git/PSEUDOREF)
484+
test $A = $(git rev-parse PSEUDOREF)
485485
'
486486

487487
test_expect_success 'overwrite pseudoref with no old value given' '
488488
git update-ref PSEUDOREF $B &&
489-
test $B = $(cat .git/PSEUDOREF)
489+
test $B = $(git rev-parse PSEUDOREF)
490490
'
491491

492492
test_expect_success 'overwrite pseudoref with correct old value' '
493493
git update-ref PSEUDOREF $C $B &&
494-
test $C = $(cat .git/PSEUDOREF)
494+
test $C = $(git rev-parse PSEUDOREF)
495495
'
496496

497497
test_expect_success 'do not overwrite pseudoref with wrong old value' '
498498
test_must_fail git update-ref PSEUDOREF $D $E 2>err &&
499-
test $C = $(cat .git/PSEUDOREF) &&
499+
test $C = $(git rev-parse PSEUDOREF) &&
500500
test_i18ngrep "unexpected object ID" err
501501
'
502502

503503
test_expect_success 'delete pseudoref' '
504504
git update-ref -d PSEUDOREF &&
505-
test_path_is_missing .git/PSEUDOREF
505+
test_must_fail git rev-parse PSEUDOREF
506506
'
507507

508508
test_expect_success 'do not delete pseudoref with wrong old value' '
509509
git update-ref PSEUDOREF $A &&
510510
test_must_fail git update-ref -d PSEUDOREF $B 2>err &&
511-
test $A = $(cat .git/PSEUDOREF) &&
511+
test $A = $(git rev-parse PSEUDOREF) &&
512512
test_i18ngrep "unexpected object ID" err
513513
'
514514

515515
test_expect_success 'delete pseudoref with correct old value' '
516516
git update-ref -d PSEUDOREF $A &&
517-
test_path_is_missing .git/PSEUDOREF
517+
test_must_fail git rev-parse PSEUDOREF
518518
'
519519

520520
test_expect_success 'create pseudoref with old OID zero' '
521521
git update-ref PSEUDOREF $A $Z &&
522-
test $A = $(cat .git/PSEUDOREF)
522+
test $A = $(git rev-parse PSEUDOREF)
523523
'
524524

525525
test_expect_success 'do not overwrite pseudoref with old OID zero' '
526526
test_when_finished git update-ref -d PSEUDOREF &&
527527
test_must_fail git update-ref PSEUDOREF $B $Z 2>err &&
528-
test $A = $(cat .git/PSEUDOREF) &&
528+
test $A = $(git rev-parse PSEUDOREF) &&
529529
test_i18ngrep "already exists" err
530530
'
531531

0 commit comments

Comments
 (0)