aboutsummaryrefslogtreecommitdiff
path: root/tests/common/git/pack
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-02-12 17:30:16 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-02-12 17:34:55 +0300
commitb7763416f8a1e4940a10336d3a8b9fbbb879f414 (patch)
tree31f1bc7427181aa81984a639d998ca4e99058199 /tests/common/git/pack
parentecb1efeebaa5597bee4cfdaab7bff4007b73127d (diff)
Clone and fetch git repositories
Diffstat (limited to 'tests/common/git/pack')
-rwxr-xr-xtests/common/git/pack29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/common/git/pack b/tests/common/git/pack
new file mode 100755
index 0000000..f53e794
--- /dev/null
+++ b/tests/common/git/pack
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+# Move git projects to tar archives.
+#
+# Usage example:
+#
+# ./pack
+#
+owd=`pwd`
+trap "{ cd $owd; exit 1; }" ERR
+set -o errtrace # Trap in functions.
+
+function info () { echo "$*" 1>&2; }
+function error () { info "$*"; exit 1; }
+
+projects=('state0/libfoo' 'state0/libbar' 'state0/style' 'state0/style-basic' \
+ 'state1/libfoo' 'state1/libbaz' 'state1/style' 'state1/style-basic')
+
+for p in "${projects[@]}"; do
+ d=$p.git
+ if [ ! -d $d ]; then
+ error "$d directory not found"
+ fi
+
+ git -C $d submodule sync --recursive
+
+ tar cf $p.tar $d
+ rm -r -f $d
+done