summaryrefslogtreecommitdiff
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-02-07 15:16:04 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-02-07 15:16:04 -0800
commit57ff1703d72db1cf33f985dcebfb03fdaab758dc (patch)
treef56f8404a9e768e3de582a662ee66325faf73c07 /t/test-lib-functions.sh
parentMerge branch 'nd/fix-perf-parameters-in-tests' into maint (diff)
parentlearn to pick/revert into unborn branch (diff)
downloadtgif-57ff1703d72db1cf33f985dcebfb03fdaab758dc.tar.xz
Merge branch 'mz/pick-unborn' into maint
"git cherry-pick" did not replay a root commit to an unborn branch. * mz/pick-unborn: learn to pick/revert into unborn branch tests: move test_cmp_rev to test-lib-functions
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh7
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: