From 85a986b3f5abc50ebd280a4b711a4617d56cd6df Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 30 Oct 2016 15:03:23 +0000 Subject: Test suite: Provide t-has-parent No callers yet. Signed-off-by: Ian Jackson --- tests/lib | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/lib b/tests/lib index 1d189a9..03bb12d 100644 --- a/tests/lib +++ b/tests/lib @@ -198,6 +198,18 @@ t-has-ancestor () { fi } +t-has-parent () { + # t-has-parent CHILD PARENT + local child=$1 + local parent=$2 + local parents=$(git show --pretty=format:' %P ' "$child") + parent=$(git rev-parse "$parent~0") + case "$parents" in + *" $parent "*) ;; + *) fail "child $child lacks parent $parent" ;; + esac +} + t-prep-newpackage () { t-select-package $1 v=$2 -- cgit v1.2.3