X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Flib;h=b80989d676946511fb3143b9a6f41d3ce8868de0;hb=00ff2e329bed2f77e314381835e3518954ad89d4;hp=1373020bab1f9b1c60c48f40763101a64b968aab;hpb=d198bbd72d591b6deba779a8d24cf9bc9ae80894;p=dgit.git diff --git a/tests/lib b/tests/lib index 1373020b..b80989d6 100644 --- a/tests/lib +++ b/tests/lib @@ -96,7 +96,7 @@ t-cloned-fetched-good () { t-diff-nogit ../extract/$p-${v%-*} . t-clean-on-branch dgit/sid t-refs-same-start - t-refs-same-more \ + t-refs-same \ refs/heads/dgit/sid \ refs/remotes/dgit/dgit/sid t-refs-notexist dgit/unstable remotes/dgit/dgit/unstable @@ -147,7 +147,7 @@ t-refs-same-start () { t_ref_val='' } -t-refs-same-more () { +t-refs-same () { local g for g in $*; do t-ref-same $g @@ -171,7 +171,7 @@ t-v-tag () { t-pushed-good () { local branch=$1 t-ref-dsc-dgit - t-refs-same-more \ + t-refs-same \ refs/heads/$branch \ `t-v-tag` \ refs/remotes/dgit/dgit/sid @@ -179,7 +179,7 @@ t-pushed-good () { refs/heads/dgit/unstable \ refs/remotes/dgit/dgit/unstable (set -e; cd $tmp/git/$p.git - t-refs-same-more \ + t-refs-same \ refs/dgit/sid \ `t-v-tag` t-refs-notexist \ @@ -188,16 +188,23 @@ t-pushed-good () { git verify-tag `t-v-tag` } -t-ref-dsc-dgit () { - local dsc=${p}_${v}.dsc - local val=`perl -e ' +t-822-field () { + local file=$1 + local field=$2 + 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/$dsc` + $h->parse(\*STDIN,"'"$file"'"); + my $val = $h->{"'$field'"},"\n"; + die "'"$file $field"'" unless defined $val; + print $val,"\n"; + ' <$file +} + +t-ref-dsc-dgit () { + local dsc=${p}_${v}.dsc + local val=`t-822-field $tmp/incoming/$dsc Dgit` + perl -e '$_=shift @ARGV; die "$dsc Dgit $_ ?" unless m/^\w+\b/;' "$val" t-ref-same-val $dsc "$val" }