summaryrefslogtreecommitdiff
path: root/tests.branching/checkout-cleans-up-on-failure.script
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2012-09-06 18:14:56 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-09-10 11:37:01 +0000
commit6075afa879da2eba9468b913332b41ff23a4e269 (patch)
tree6eac5ca3e94f261692f8dfb3d0caac24b0e9b68a /tests.branching/checkout-cleans-up-on-failure.script
parent7f493ba9b6c60f25e21c16fd85ce80ceec31f2fc (diff)
downloadmorph-6075afa879da2eba9468b913332b41ff23a4e269.tar.gz
morph branch,checkout: Clean up the branch dir on failure
Diffstat (limited to 'tests.branching/checkout-cleans-up-on-failure.script')
-rwxr-xr-xtests.branching/checkout-cleans-up-on-failure.script27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests.branching/checkout-cleans-up-on-failure.script b/tests.branching/checkout-cleans-up-on-failure.script
new file mode 100755
index 00000000..b2a59e6c
--- /dev/null
+++ b/tests.branching/checkout-cleans-up-on-failure.script
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright (C) 2012 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.
+
+# If a command fails, the state of the workspace should be as if the command
+# was never run
+
+set -eu
+
+cd "$DATADIR/workspace"
+"$SRCDIR/scripts/test-morph" init
+
+"$SRCDIR/scripts/test-morph" checkout baserock:morphs i/do/not/exist || true
+
+[ ! -d "$DATADIR/workspace/i" ]