chiark / gitweb /
autopkgtests: introduce t-v-tag to massage version number for git tag name
[dgit.git] / tests / lib
index 1d2d06ade6fd4a6fa1857b2d4360822c92eb4139..3e1a5be1a3d4f0642b6821a1d60979606280e272 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -103,7 +103,7 @@ t-clean-on-branch () {
 
 t-git-get-ref () {
        local ref=$1
-       git-show-ref -d $1 | perl -ne '
+       git show-ref -d $1 | perl -ne '
                $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#;
                END { print "$x\n" if length $x; }
        '
@@ -130,11 +130,16 @@ t-refs-notexist () {
        done
 }
 
+t-v-tag () {
+       echo refs/tags/debian/${v//\~/_}
+}
+
 t-pushed-good () {
+       local branch=$1
        t-ref-dsc-dgit
        t-refs-same-more \
-               refs/heads/master \
-               refs/tags/debian/$v \
+               refs/heads/$branch \
+               `t-v-tag` \
                refs/remotes/dgit/dgit/sid
        t-refs-notexist \
                refs/heads/dgit/unstable \
@@ -142,7 +147,7 @@ t-pushed-good () {
        (set -e; cd $tmp/git/$p.git
         t-refs-same-more \
                refs/dgit/sid \
-               refs/tags/debian/$v
+               `t-v-tag`
         t-refs-notexist \
                refs/dgit/unstable
        )
@@ -158,3 +163,10 @@ t-ref-dsc-dgit () {
                print $ref,"\n";
        ' <$tmp/incoming/${p}_${v}.dsc >$tmp/t.ref1
 }
+
+t-apply-diff () {
+       local v1=$1
+       local v2=$2
+       (cd $troot/pkg-srcs; debdiff ${p}_${v1}.dsc ${p}_${v2}.dsc) \
+               | patch -p1 -u
+}