Catched GitRepositoryError to avoid crashes 'Currently not on a
authorEd Bartosh <eduard.bartosh@intel.com>
Tue, 26 Jun 2012 07:34:39 +0000 (10:34 +0300)
committerEd Bartosh <eduard.bartosh@intel.com>
Wed, 27 Jun 2012 08:38:05 +0000 (11:38 +0300)
branch' and similar. Fixes #85

Change-Id: Icc125010b0bf2c2a89392f97502171f4d4dff125

gitbuildsys/cmd_build.py
gitbuildsys/cmd_export.py

index 95b3611..52274c1 100644 (file)
@@ -383,7 +383,7 @@ def do(opts, args):
             if not git_archive(repo, spec, "%s/packaging" % workdir, 'HEAD',
                                comp_type, comp_level=9, with_submodules=True):
                 msger.error("Cannot create source tarball %s" % tarball)
-        except GbpError, exc:
+        except (GbpError, GitRepositoryError), exc:
             msger.error(str(exc))
 
     if opts.incremental:
index fc7019f..2e64129 100644 (file)
@@ -102,5 +102,5 @@ def do(opts, args):
         if not git_archive(repo, spec, outdir, 'HEAD',
                            comp_type, comp_level=9, with_submodules=True):
             msger.error("Cannot create source tarball %s" % tarball)
-    except GbpError, exc:
+    except (GbpError, GitRepositoryError), exc:
         msger.error(str(exc))