chiark / gitweb /
test suite: lib-gdr: Factor out t-make-orig
[dgit.git] / tests / lib
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