From c03b4097c7fadd4366db816732bd69f7ee2433fe Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 21 Jan 2025 12:48:18 +0100 Subject: just-lock: Ensure all commands use the run_cmd method --- bin/just-lock.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'bin/just-lock.py') diff --git a/bin/just-lock.py b/bin/just-lock.py index b4cdd078..a3650d0a 100755 --- a/bin/just-lock.py +++ b/bin/just-lock.py @@ -277,11 +277,10 @@ def ensure_git_init(*, def git_commit_present(commit: str, *, upstream: Optional[str]) -> bool: """Check if commit is present in specified Git repository.""" - result = subprocess.run(g_LAUNCHER + [g_GIT, "show", "--oneline", commit], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - cwd=git_root(upstream=upstream)) - return result.returncode == 0 + return run_cmd(g_LAUNCHER + [g_GIT, "show", "--oneline", commit], + stdout=subprocess.DEVNULL, + cwd=git_root(upstream=upstream), + fail_context=None)[1] == 0 def git_url_is_path(url: str) -> Optional[str]: -- cgit v1.2.3