Skip to content

Commit eebb816

Browse files
committed
fix ci errors
1 parent 3f81e72 commit eebb816

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

commit0/harness/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def setup_git(logger: logging.Logger) -> None:
9494
"sudo -u git bash -c 'mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys'",
9595
"sets up .ssh directory for git",
9696
),
97+
("sudo touch /etc/shells", "creates /etc/shells if it doesn't exists yet"),
9798
("cat /etc/shells", "views available shells"),
9899
("sudo which git-shell >> /etc/shells", "adds git-shell to /etc/shells"),
99100
(
@@ -108,7 +109,7 @@ def setup_git(logger: logging.Logger) -> None:
108109

109110
def is_safe_directory_added(safe_directory: str) -> bool:
110111
# Run command to get all safe directories
111-
command = "git config --system --get-all safe.directory"
112+
command = "sudo git config --system --get-all safe.directory"
112113
stdout, stderr, exit_code = run_command(command)
113114

114115
# Check if the directory is listed
@@ -123,7 +124,7 @@ def add_safe_directory(safe_directory: str, logger: logging.Logger) -> None:
123124
# Check if the directory is already added
124125
if not is_safe_directory_added(safe_directory):
125126
# Command to add the directory to safe.directory
126-
command = f"git config --system --add safe.directory {safe_directory}"
127+
command = f"sudo git config --system --add safe.directory {safe_directory}"
127128
stdout, stderr, exit_code = run_command(command)
128129

129130
if exit_code == 0:

0 commit comments

Comments
 (0)