[Concept,03/11] patman: Strip version suffix in get_series_upstream()

Message ID 20260329150140.4095446-4-sjg@u-boot.org
State New
Headers
Series patman: Add workflow tracking for patch series |

Commit Message

Simon Glass March 29, 2026, 3:01 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

When get_series_upstream() auto-detects the series from the current
branch, it uses the raw branch name (e.g. 'bootma-us2') without
stripping the version suffix. This causes the database lookup to fail,
so the per-upstream patchwork URL is not found and patman falls back to
the wrong server.

Call split_name_version() to strip the version number, matching what
_parse_series() already does. Also pass self.gitdir to get_branch()

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/patman/cser_helper.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/tools/patman/cser_helper.py b/tools/patman/cser_helper.py
index ec3956db4d5..0b9f670ca25 100644
--- a/tools/patman/cser_helper.py
+++ b/tools/patman/cser_helper.py
@@ -435,7 +435,8 @@  class CseriesHelper:
             str or None: Upstream name, or None if not found
         """
         if not name:
-            name = gitutil.get_branch()
+            name = gitutil.get_branch(self.gitdir)
+        name, _ = patchstream.split_name_version(name)
         ser = self.get_series_by_name(name)
         if ser:
             return ser.upstream