Skip to content
Snippets Groups Projects
Commit 152cb0cd authored by Junio C Hamano's avatar Junio C Hamano
Browse files

Merge branch 'sg/test-cmp-rev'

Test framework update.

* sg/test-cmp-rev:
  test-lib-functions: make 'test_cmp_rev' more informative on failure
parents 2c23f0b6 30d0b6dc
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -854,9 +854,23 @@ test_must_be_empty () {
 
# Tests that its two parameters refer to the same revision
test_cmp_rev () {
git rev-parse --verify "$1" >expect.rev &&
git rev-parse --verify "$2" >actual.rev &&
test_cmp expect.rev actual.rev
if test $# != 2
then
error "bug in the test script: test_cmp_rev requires two revisions, but got $#"
else
local r1 r2
r1=$(git rev-parse --verify "$1") &&
r2=$(git rev-parse --verify "$2") &&
if test "$r1" != "$r2"
then
cat >&4 <<-EOF
error: two revisions point to different objects:
'$1': $r1
'$2': $r2
EOF
return 1
fi
fi
}
 
# Print a sequence of integers in increasing order, either with
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment