histedit: remove an unnecessary default value of `b''` for commit message
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 24 Mar 2022 16:55:09 -0700
changeset 49088 7bdf19f892c6
parent 49087 e160f073c37b
child 49089 7bd5f862b249
histedit: remove an unnecessary default value of `b''` for commit message I don't think `ctx.description()` is ever anything falsy other than `b''`. I think the comment added in 4c4232e51167 (histedit: extract common summary code into method, 2016-05-27) is mistaken (I don't see any code following that pattern before the function was added). Differential Revision: https://phab.mercurial-scm.org/D12406
hgext/histedit.py
--- a/hgext/histedit.py	Thu Mar 24 16:51:20 2022 -0700
+++ b/hgext/histedit.py	Thu Mar 24 16:55:09 2022 -0700
@@ -2319,10 +2319,7 @@
 
 
 def _getsummary(ctx):
-    # a common pattern is to extract the summary but default to the empty
-    # string
-    summary = ctx.description() or b''
-    return stringutil.firstline(summary)
+    return stringutil.firstline(ctx.description())
 
 
 def bootstrapcontinue(ui, state, opts):