chiark / gitweb /
test suite: lib-gdr: Factor out t-make-orig
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Aug 2018 00:18:08 +0000 (01:18 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Aug 2018 01:21:58 +0000 (02:21 +0100)
NFC, overall.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/lib
tests/lib-gdr

index 42e1344ded97e3a0300f5df1ca3950e866b4dd78..9693c2531a5a1d40370a9ec32694a6056ce77d36 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -1026,6 +1026,15 @@ t-make-badcommit () {
        t-expect-fsck-fail $badcommit
 }
 
+t-make-orig () {
+       # leaves ust set to filename of orig tarball
+       local p=$1
+       local v=$2
+       local tag=${3-v$2}
+       ust=${p}_${v}.orig.tar.gz
+       git archive -o ../$ust --prefix=${p}-${v}/ $tag
+}
+
 t-merge-conflicted-stripping-conflict-markers () {
        local otherbranch=$1
        local file=$2
index 251143e3fe89b2828379978c92f7905de70a3a3e..cda11df5b8d5fe7d322d9f8f8168cc44c2554746 100644 (file)
@@ -229,11 +229,9 @@ t-some-changes () {
 t-make-new-upstream-tarball () {
        local uv=$1
        git checkout make-upstream
-       # leaves ust set to filename of orig tarball
        echo "upstream $uv" >>docs/README
        git commit -a -m "upstream $uv tarball"
-       ust=example_$uv.orig.tar.gz
-       git archive -o ../$ust --prefix=example-2.0/ make-upstream
+       t-make-orig example $uv make-upstream
 }
 
 t-nmu-upload-1 () {