diff options
author | Daniel Firth <dan.firth@codethink.co.uk> | 2013-10-30 15:19:44 +0000 |
---|---|---|
committer | Daniel Firth <dan.firth@codethink.co.uk> | 2013-11-01 15:27:10 +0000 |
commit | 2d16996377f369c97d35b7b48bdd336c2e8f5a08 (patch) | |
tree | 9eb963204bf137e8346b1a88e44d281c1d98adcb /morphlib | |
parent | 0b6516bb591dd51c14993f6e60b0da3197a32054 (diff) | |
download | morph-2d16996377f369c97d35b7b48bdd336c2e8f5a08.tar.gz |
Added scenario test for preventing building uncommitted systems
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index 260c0e48..a2d2174a 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -1765,10 +1765,17 @@ class BranchAndMergePlugin(cliapp.Plugin): ['git', 'hash-object', '-t', 'blob', '-w', f.name], cwd=repo_dir, env=env) - self.app.runcmd( + try: + self.app.runcmd( ['git', 'update-index', '--cacheinfo', '100644', morphology_sha1, '%s.morph' % filename], cwd=repo_dir, env=env) + except cliapp.AppException, e: + raise cliapp.AppException( + "You seem to want to build %s, but '%s.morph' " + "doesn't exist in the morphologies repository. " + "Did you forget to commit it?" % + (filename, filename)) # Create a commit message including the build UUID. This allows us # to collect all commits of a build across repositories and thereby |