chiark / gitweb /
autopkgtests: t-pushed-good takes local branch name argument
[dgit.git] / tests / lib
index 1d2d06ade6fd4a6fa1857b2d4360822c92eb4139..b9ce24be192486df55ee2da1ef064f03ace208d7 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; }
        '
@@ -131,9 +131,10 @@ t-refs-notexist () {
 }
 
 t-pushed-good () {
+       local branch=$1
        t-ref-dsc-dgit
        t-refs-same-more \
-               refs/heads/master \
+               refs/heads/$branch \
                refs/tags/debian/$v \
                refs/remotes/dgit/dgit/sid
        t-refs-notexist \
@@ -158,3 +159,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
+}