From 2dac60c94a4a47db6997c50c17519bf01d884d6d Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Wed, 5 Nov 2025 22:40:12 +0100 Subject: [PATCH] [update-checkout] Use `basename` to get repo name for Git failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `os.path.dirname` removes the last path component of a path. If there was a git failure in `~/src/swift`, this means that we show `~/src` as the repo name, which isn’t very helpful. Use `os.path.basename`, which returns the last path component, ie. `swift`. --- utils/update_checkout/update_checkout/git_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/update_checkout/update_checkout/git_command.py b/utils/update_checkout/update_checkout/git_command.py index 1634aa5836573..ede7ec5f08ef6 100644 --- a/utils/update_checkout/update_checkout/git_command.py +++ b/utils/update_checkout/update_checkout/git_command.py @@ -78,7 +78,7 @@ def run( f"status {str(e.returncode)}, aborting" ) raise GitException( - e.returncode, command, os.path.dirname(repo_path), output + e.returncode, command, os.path.basename(repo_path), output ) except OSError as e: if fatal: