chiark / gitweb /
test suite: baredebian: Break out baredebian-tarball-mode
[dgit.git] / tests / lib-baredebian
index d3af727608e261e45071d84605b91231b84840dc..abec753af6c78f1ed8df7ddf12fc7b50518462ee 100644 (file)
@@ -1,17 +1,26 @@
 #
 
-baredebian-test () {
+baredebian-test-vars () {
        quiltmode=baredebian
+       v=1.0-1
+       suite=sid
+       uv=${v%-*}
+       uvtag=v$uv
+}
+
+baredebian-tarball-mode () {
+       git tag -d $uvtag
+       uvtag=''
+       quiltmode=baredebian+tarball
+}
 
+baredebian-test-core () {
        t-expect-fail 'contradicts clean mode git-ff' \
        t-dgit -wgf --dgit-view-save=split.f1 --$quiltmode quilt-fixup
 
        t-dgit -wn --dgit-view-save=split.f1 --$quiltmode quilt-fixup
 
-       v=1.0-1
-       suite=sid
-
-       tar --strip-components=1 -axf ../${p}_${v%-*}.orig.tar.*
+       tar --strip-components=1 -axf ../${p}_${uv}.orig.tar.*
 
        cd debian
        git clean -xdff
@@ -45,9 +54,11 @@ baredebian-test () {
        t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.b quilt-fixup
        t-dgit -wn --quilt=$quiltmode --dgit-view-save=split.p --new push
 
-       git merge-base --is-ancestor v${v%-*} split.p
        git merge-base --is-ancestor HEAD     split.p
-       set +e; git merge-base HEAD v${v%-*}; rc=$?; set -e; [ $rc = 1 ]
+       if [ "$uvtag" ]; then
+               git merge-base --is-ancestor $uvtag split.p
+               set +e; git merge-base HEAD $uvtag; rc=$?; set -e; [ $rc = 1 ]
+       fi
 
        git clean -xdff
        # t-pushed-good-* wants a clean tree to start with, but this
@@ -64,3 +75,8 @@ baredebian-test () {
 
        t-splitbrain-pushed-good-end-made-dep14
 }
+
+baredebian-test () {
+       baredebian-test-vars
+       baredebian-test-core
+}