diff options
author | Martin von Zweigbergk <martinvonz@gmail.com> | 2012-12-21 11:10:10 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-12-22 19:06:35 -0800 |
commit | 5d77298d084f01a854c8aecc1709acf53d956ef8 (patch) | |
tree | 4ead32901d2e113cd03fbf58a9685bc5beac7ec6 /t/test-lib-functions.sh | |
parent | b3cf6f3b8d21b32d88313fc709442b78300975db (diff) | |
download | git-5d77298d084f01a854c8aecc1709acf53d956ef8.tar.gz |
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>
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r-- | t/test-lib-functions.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 22a4f8fb64..fa62d010f6 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -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: |