Do not use git -C dir

Older versions of git (≤ 1.8.5) do not support the `-C dir` global
option. Use the `cwd` optional argument when using Python's
`subprocess` functionality instead.
This commit is contained in:
Samuel Tardieu 2025-09-16 21:51:39 +02:00
parent eec6bd9d69
commit b79a4bfad6

View file

@ -1193,8 +1193,6 @@ class RustBuild(object):
return "<commit>"
cmd = [
"git",
"-C",
repo_path,
"rev-list",
"--author",
author_email,
@ -1202,7 +1200,9 @@ class RustBuild(object):
"HEAD",
]
try:
commit = subprocess.check_output(cmd, universal_newlines=True).strip()
commit = subprocess.check_output(
cmd, universal_newlines=True, cwd=repo_path
).strip()
return commit or "<commit>"
except subprocess.CalledProcessError:
return "<commit>"