From 6094d8fc8c193b27df8bf74826076dd8d26e0c42 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Wed, 31 Aug 2022 17:07:20 -0400 Subject: Fix regression with b4 trailers -u Fixes regression introduced by trailers refactor. Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 2 +- b4/ez.py | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/b4/__init__.py b/b4/__init__.py index 4062ec3..7439fb8 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1719,7 +1719,7 @@ class LoreMessage: logger.info(' + %s%s', ltr.as_string(omit_extinfo=True), extra) - if addmysob: + if addmysob or hasmysob: # Tack on our signoff at the bottom fixtrailers.append(sobtr) if not hasmysob: diff --git a/b4/ez.py b/b4/ez.py index 965ae6e..12dbf2c 100644 --- a/b4/ez.py +++ b/b4/ez.py @@ -720,18 +720,17 @@ def update_trailers(cmdargs: argparse.Namespace) -> None: continue parts = b4.LoreMessage.get_body_parts(commit_map[commit].get_payload()) - for ftrailer in addtrailers: - if ftrailer[:3] not in parts[2]: + for fltr in addtrailers: + if fltr not in parts[2]: if commit not in updates: updates[commit] = list() - updates[commit].append(ftrailer) + updates[commit].append(fltr) # Check if we've applied mismatched trailers already if not cmdargs.sloppytrailers and mismatches: - for mtrailer in list(mismatches): - check = (mtrailer[0], mtrailer[1], None) - if check in parts[2]: + for mltr in list(mismatches): + if mltr in parts[2]: logger.debug('Removing already-applied mismatch %s', check) - mismatches.remove(mtrailer) + mismatches.remove(mltr) if len(mismatches): logger.critical('---') -- cgit v1.2.3