summaryrefslogtreecommitdiff
path: root/tests/raw-single-file.script
diff options
context:
space:
mode:
Diffstat (limited to 'tests/raw-single-file.script')
-rwxr-xr-xtests/raw-single-file.script36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/raw-single-file.script b/tests/raw-single-file.script
new file mode 100755
index 0000000..b46e0c1
--- /dev/null
+++ b/tests/raw-single-file.script
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Tests converting a folder with one raw file to a git repository.
+#
+# Copyright (C) 2022 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+set -e
+
+logfile="$DATADIR/raw-single-file.log"
+workdir="$DATADIR/work-dir"
+
+"${SRCDIR}/test-lorry" --pull-only --log="$logfile" --working-area="$workdir" \
+ "$DATADIR/raw-single-file.lorry" > /dev/null
+
+# verify that the git repository was created successfully
+cd "$workdir/single-file-repo/git-a/"
+
+# verify the file has been added correctly
+git ls-tree -r --name-only HEAD
+
+# list the commit messages
+git log --pretty='%s' master | sed -e"s,${DATADIR},DATADIR,"