+
+t-refs-notexist () {
+ for g in $*; do
+ t-git-get-ref $g >$tmp/t.refx
+ diff /dev/null $tmp/t.refx
+ 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/$branch \
+ `t-v-tag` \
+ refs/remotes/dgit/dgit/sid
+ t-refs-notexist \
+ refs/heads/dgit/unstable \
+ refs/remotes/dgit/dgit/unstable
+ (set -e; cd $tmp/git/$p.git
+ t-refs-same-more \
+ refs/dgit/sid \
+ `t-v-tag`
+ t-refs-notexist \
+ refs/dgit/unstable
+ )
+ git verify-tag `t-v-tag`
+}
+
+t-ref-dsc-dgit () {
+ perl -e '
+ use Dpkg::Control::Hash;
+ my $h = new Dpkg::Control::Hash allow_pgp=>1;
+ $h->parse(\*STDIN,"dsc");
+ my $ref = $h->{"Dgit"},"\n";
+ die unless $ref =~ m/^\w+\b/;
+ 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
+}