X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=tests%2Flib;h=36237a7485ed008f136ff4afd1c03dd2f3f3a6e5;hb=fbc24ade1654c35ac59f8c6f4ebaaba0e65930ee;hp=82ef7c269d2fb3b914644579ee7319c85e3ce7a3;hpb=19931bdaf42b226ff573acd88dea8db8286cc9c7;p=dgit.git diff --git a/tests/lib b/tests/lib index 82ef7c26..36237a74 100644 --- a/tests/lib +++ b/tests/lib @@ -508,6 +508,28 @@ t-v-tag () { echo refs/tags/$tagpfx/${v//\~/_} } +t-format-ref () { + git log -n1 --pretty=format:"$1" "$2" +} + +t-sametree-parent () { + local ref=$1 + local parent + local ctree=$(t-format-ref '%T' "$ref") + while :; do + local psame='' + for parent in $(t-format-ref '%P' "$ref"); do + local ptree=$(t-format-ref '%T' "$parent") + if [ "x$ptree" = "x$ctree" ]; then + psame+=" $parent" + fi + done + case "$psame" in ""|" * *") break ;; esac + ref="${psame# }" + done + echo "$ref" +} + t-check-pushed-master () { local master=`t-git-get-ref refs/heads/master` if [ x$master = x$t_ref_val ]; then return; fi @@ -654,7 +676,7 @@ t-gbp-example-prep () { t-commit () { local msg=$1 - v=${2:-1.$revision} + v=${2:-${majorv:-1}.$revision} dch -v$v --distribution ${3:-unstable} "$1" git add debian/changelog debcommit