The patch from [bpo-44074]() does not account for a possibly non-English locale and blindly greps for "HEAD branch" in a possibly localized text.
Automerge-Triggered-By: GH:pitrou
It is typically called 'main', but may differ
"""
cmd = "git remote show {}".format(remote_name).split()
+ env = os.environ.copy()
+ env['LANG'] = 'C'
try:
remote_info = subprocess.check_output(cmd,
stderr=subprocess.DEVNULL,
cwd=SRCDIR,
- encoding='UTF-8')
+ encoding='UTF-8',
+ env=env)
except subprocess.CalledProcessError:
return None
for line in remote_info.splitlines():