Skip to content

Commit 2dac60c

Browse files
committed
[update-checkout] Use basename to get repo name for Git failures
`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`.
1 parent dad2637 commit 2dac60c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/update_checkout/update_checkout/git_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def run(
7878
f"status {str(e.returncode)}, aborting"
7979
)
8080
raise GitException(
81-
e.returncode, command, os.path.dirname(repo_path), output
81+
e.returncode, command, os.path.basename(repo_path), output
8282
)
8383
except OSError as e:
8484
if fatal:

0 commit comments

Comments
 (0)