Skip to content

Commit

Permalink
Consider all git repositories managed by aliBuild as safe.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Jun 5, 2024
1 parent 2b9f292 commit 7a76710
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion alibuild_helpers/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ def git(args, directory=".", check=True, prompt=True):
err, output = getstatusoutput("""\
set -e +x
cd {directory} >/dev/null 2>&1
{prompt_var} git {args}
{prompt_var} {directory_safe_var} git {args}
""".format(
directory=quote(directory),
args=" ".join(map(quote, args)),
# GIT_TERMINAL_PROMPT is only supported in git 2.3+.
prompt_var="GIT_TERMINAL_PROMPT=0" if not prompt else "",
directory_safe_var="GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.directory GIT_CONFIG_VALUE_0={}".format(directory) if directory else "",
), timeout=GIT_COMMAND_TIMEOUT_SEC)
if check and err != 0:
raise SCMError("Error {} from git {}: {}".format(err, " ".join(args), output))
Expand Down

0 comments on commit 7a76710

Please sign in to comment.