changeset 49023:7bdf19f892c6

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
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 24 Mar 2022 16:55:09 -0700
parents e160f073c37b
children 7bd5f862b249
files hgext/histedit.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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):