chiark / gitweb /
Test suite: unapplied-pq2qc: move into lib as a t- subroutine
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Jun 2016 15:16:12 +0000 (16:16 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jul 2016 15:47:48 +0000 (16:47 +0100)
tests/lib
tests/unapplied-pq2qc [deleted file]

index 48bc237347fe00a525110bc5d8f788b2f1dd6ebd..0b8836266fbfc1746a16a09a2d71c10205a19a06 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -512,6 +512,28 @@ t-apply-diff () {
         | patch -p1 -u
 }
 
         | patch -p1 -u
 }
 
+t-gbp-unapplied-pq2qc () {
+       # does `gbp pq export' (leaving us on BRANCH (eg "quilt-tip"))
+       # commits the resulting debian/patches on  qc/BRANCH
+       # goes back to patch-queue/BRANCH
+       # qc/BRANCH is not fast-forwarding
+
+       gbp pq export
+
+       branch=`git symbolic-ref HEAD`
+       branch=${branch#refs/heads/}
+
+       case "$branch" in
+       */*) fail "unexpected branch $branch" ;;
+       esac
+
+       git branch -f qc/$branch
+       git checkout qc/$branch
+       git add debian/patches
+       git commit -m 'Commit patch queue'
+       git checkout patch-queue/$branch
+}
+
 t-commit () {
        local msg=$1
        v=${2-1.$revision}
 t-commit () {
        local msg=$1
        v=${2-1.$revision}
diff --git a/tests/unapplied-pq2qc b/tests/unapplied-pq2qc
deleted file mode 100755 (executable)
index 03b2cdf..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-set -e
-fail () { echo >&2 "$0: $*"; exit 1; }
-
-# does `gbp pq export' (leaving us on BRANCH (eg "quilt-tip"))
-# commits the resulting debian/patches on  qc/BRANCH
-# goes back to patch-queue/BRANCH
-# qc/BRANCH is not fast-forwarding
-
-gbp pq export
-
-branch=`git symbolic-ref HEAD`
-branch=${branch#refs/heads/}
-
-case "$branch" in
-*/*) fail "unexpected branch $branch" ;;
-esac
-
-git branch -f qc/$branch
-git checkout qc/$branch
-git add debian/patches
-git commit -m 'Commit patch queue'
-git checkout patch-queue/$branch