X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Ftests%2Fprotocol-compat;h=fcbeedb82d7cc02c4b786e32d4b407aa6b0c01a3;hb=48cd6449acfebc08b1ba2c00871737759c285216;hp=47074d51b2654a369f0b398baec6421ef24f906e;hpb=866a4b0d97a4863c9c0c2f6b984d8f373b11af52;p=dgit.git diff --git a/tests/tests/protocol-compat b/tests/tests/protocol-compat index 47074d51..fcbeedb8 100755 --- a/tests/tests/protocol-compat +++ b/tests/tests/protocol-compat @@ -6,35 +6,78 @@ set -e t-setup-import examplegit t-tstunt-parsechangelog +t-git-config dgit.default.distro foreign +t-git-config dgit-distro.foreign.cmd-git false + prep () { dscf=$tmp/mirror/pool/main/example_$v.dsc } check () { + pd=$p.$suite + t-refs-same-start + t-archive-none $p t-archive-query $suite - t-dgit clone $p stable $p.cloned - cd $p.cloned + t-dgit clone $p $suite $pd + cd $pd t-ref-head + $1 + + local distro='' t-dgit import-dsc $dscf +imported t-ref-same refs/heads/imported cd .. } +reset () { + cd .. + rm -rf $pd + mkdir $pd + cd $pd + git init +} + +: ---------- newer ---------- + +suite=sid +v=2.1 +prep + +perl -i~ -pe 's/^Dgit: .*/$& EXTRA DATA\n TO BE IGNORED/' $dscf + +check reset + +: ---------- newline ---------- + +suite=testing +v=2.0 +prep + +perl -i~ -pe 's/^(Dgit: \w+ \S+ \S+) (.*)/$1\n $2 EXTRA/' $dscf + +check reset + : ---------- older ---------- suite=stable v=1.2 - prep perl -i -pe 's/^(Dgit: \w+).*/$1/' $dscf -dgit_config_debian_alias='-cdgit-distro.debian.alias-canon=test-dummy' -# old Dgit fields are supposed to mean Debian - check -#t-ok +: ---------- expect fail ---------- + +pd=$p.fail + +t-git-config dgit.default.old-dsc-distro downstream + +t-expect-fail 'no configured url and .dsc provides no hint' \ +t-dgit clone $p $suite $pd + + +t-ok