X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Flib;h=3e1a5be1a3d4f0642b6821a1d60979606280e272;hb=08b040602f3663733bf89289d0b63a3432ac0ac1;hp=1d2d06ade6fd4a6fa1857b2d4360822c92eb4139;hpb=c2d43f9859a861f8522c32bb42e9f74fd229b6bf;p=dgit.git diff --git a/tests/lib b/tests/lib index 1d2d06ad..3e1a5be1 100644 --- 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 +}