From 049a00c428869535282ef959b19d12299758071d Mon Sep 17 00:00:00 2001 From: Kern Handa Date: Tue, 19 Nov 2024 13:34:20 -0800 Subject: [PATCH] Robustify parsing of the PR reference --- src/stack_pr/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stack_pr/cli.py b/src/stack_pr/cli.py index 957abe4..764ce39 100755 --- a/src/stack_pr/cli.py +++ b/src/stack_pr/cli.py @@ -398,7 +398,7 @@ def is_valid_ref(ref: str, branch_name_template: str) -> bool: def last(ref: str, sep: str = "/") -> str: - return ref.rsplit("/", 1)[1] + return ref.rsplit(sep, 1)[-1] # TODO: Move to 'modular.utils.git'