tests: move test_cmp_rev to test-lib-functions

A function for checking that two given parameters refer to the same
revision was defined in several places, so move the definition to
test-lib-functions.sh instead.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Martin von Zweigbergk
2012-12-21 11:10:10 -08:00
committed by Junio C Hamano
parent b3cf6f3b8d
commit 5d77298d08
7 changed files with 15 additions and 40 deletions

View File

@ -602,6 +602,13 @@ test_cmp() {
$GIT_TEST_CMP "$@"
}
# 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
}
# Print a sequence of numbers or letters in increasing order. This is
# similar to GNU seq(1), but the latter might not be available
# everywhere (and does not do letters). It may be used like: