Skip to contentSkip to conversation

stgit new: Do not open editor if --save-template was specified

PATCH New Gustav Hållberg 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stgit new: Do not open editor if --save-template was specified

Fixes side-effect of e58f264a3e59a0887c7aaa1e3227cff108ac840d

I'm not sure this is the right way to fix the problem, but an editor should not be opened if "--save-template" was specified to "stg new", as it is used for batch processes.

---
 stgit/commands/new.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
stgit/commands/new.py +2 -1
index 9fd51c3..158193e 100644
@@ -67,7 +67,8 @@ def func(parser, options, args):
     cd = gitlib.CommitData(
         tree = stack.head.data.tree, parents = [stack.head], message = '',
         author = gitlib.Person.author(), committer = gitlib.Person.committer())
-    cd = common.update_commit_data(cd, options, allow_edit = True)
+    cd = common.update_commit_data(cd, options,
+                                   allow_edit = not options.save_template)
 
     if options.save_template:
         options.save_template(cd.message)