summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/missing-ref.exit1
-rwxr-xr-xtests/missing-ref.script28
-rw-r--r--tests/missing-ref.stderr4
3 files changed, 33 insertions, 0 deletions
diff --git a/tests/missing-ref.exit b/tests/missing-ref.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/tests/missing-ref.exit
@@ -0,0 +1 @@
+1
diff --git a/tests/missing-ref.script b/tests/missing-ref.script
new file mode 100755
index 00000000..e11653ea
--- /dev/null
+++ b/tests/missing-ref.script
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Test building with a bad reference.
+#
+# Copyright (C) 2011 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
+
+cache="$DATADIR/build-chunk-cache"
+mkdir "$cache"
+./morph --no-default-configs build repo non-existent-branch hello.morph \
+ --git-base-url "file://$DATADIR/" \
+ --cachedir="$cache" --keep-path
+rm -rf "$cache"
+
diff --git a/tests/missing-ref.stderr b/tests/missing-ref.stderr
new file mode 100644
index 00000000..5cf767b3
--- /dev/null
+++ b/tests/missing-ref.stderr
@@ -0,0 +1,4 @@
+ERROR: Command failed: git cat-file blob non-existent-branch:hello.morph
+Output from command:
+fatal: Not a valid object name non-existent-branch:hello.morph
+