chiark / gitweb /
Do not raise an exception if no FETCH_HEAD
[stgit] / stgit / main.py
index 15582ddff9e21f426ff47bbae2af1114d3afacf4..e8242c2783bddd18122b345512f9e155495538f7 100644 (file)
@@ -271,18 +271,16 @@ def main():
         directory.setup()
         config_setup()
 
-        # 'clone' doesn't expect an already initialised GIT tree. A Series
-        # object will be created after the GIT tree is cloned
-        if cmd != 'clone':
+        # Some commands don't (always) need an initialized series.
+        if directory.needs_current_series:
             if hasattr(options, 'branch') and options.branch:
                 command.crt_series = Series(options.branch)
             else:
                 command.crt_series = Series()
-            stgit.commands.common.crt_series = command.crt_series
 
         command.func(parser, options, args)
     except (StgException, IOError, ParsingError, NoSectionError), err:
-        print >> sys.stderr, '%s %s: %s' % (prog, cmd, err)
+        out.error(str(err), title = '%s %s' % (prog, cmd))
         if debug_level > 0:
             raise
         else: