diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-09-06 18:14:56 +0100 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-09-10 11:37:01 +0000 |
commit | 6075afa879da2eba9468b913332b41ff23a4e269 (patch) | |
tree | 6eac5ca3e94f261692f8dfb3d0caac24b0e9b68a /tests.branching/checkout-cleans-up-on-failure.script | |
parent | 7f493ba9b6c60f25e21c16fd85ce80ceec31f2fc (diff) | |
download | morph-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-x | tests.branching/checkout-cleans-up-on-failure.script | 27 |
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" ] |