File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -854,9 +854,23 @@ test_must_be_empty () {
854854
855855# Tests that its two parameters refer to the same revision
856856test_cmp_rev () {
857- git rev-parse --verify " $1 " > expect.rev &&
858- git rev-parse --verify " $2 " > actual.rev &&
859- test_cmp expect.rev actual.rev
857+ if test $# ! = 2
858+ then
859+ error " bug in the test script: test_cmp_rev requires two revisions, but got $# "
860+ else
861+ local r1 r2
862+ r1=$( git rev-parse --verify " $1 " ) &&
863+ r2=$( git rev-parse --verify " $2 " ) &&
864+ if test " $r1 " ! = " $r2 "
865+ then
866+ cat >&4 << -EOF
867+ error: two revisions point to different objects:
868+ '$1 ': $r1
869+ '$2 ': $r2
870+ EOF
871+ return 1
872+ fi
873+ fi
860874}
861875
862876# Print a sequence of integers in increasing order, either with
You can’t perform that action at this time.
0 commit comments