From 37cebc1f8ffead55e5e0fadfe54798ea3c57a8ff Mon Sep 17 00:00:00 2001 From: greese-insight <124088146+greese-insight@users.noreply.github.com> Date: Wed, 6 Aug 2025 14:25:26 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20update=20git=20config=20to=20handle=20th?= =?UTF-8?q?e=20necessary=20user=20name=20and=20email=20se=E2=80=A6=20(#997?= =?UTF-8?q?5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openhands/runtime/action_execution_server.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/openhands/runtime/action_execution_server.py b/openhands/runtime/action_execution_server.py index ac45a48086..b88a9a46cf 100644 --- a/openhands/runtime/action_execution_server.py +++ b/openhands/runtime/action_execution_server.py @@ -363,20 +363,21 @@ class ActionExecutor: '$env:GIT_CONFIG = (Join-Path (Get-Location) ".git_config")' ) else: - # Linux/macOS, local - base_git_config = ( - f'git config --file ./.git_config user.name "{self.git_user_name}" && ' - f'git config --file ./.git_config user.email "{self.git_user_email}" && ' - 'export GIT_CONFIG=$(pwd)/.git_config' + INIT_COMMANDS.append( + f'git config --file ./.git_config user.name "{self.git_user_name}"' ) - INIT_COMMANDS.append(base_git_config) + INIT_COMMANDS.append( + f'git config --file ./.git_config user.email "{self.git_user_email}"' + ) + INIT_COMMANDS.append('export GIT_CONFIG=$(pwd)/.git_config') else: # Non-local (implies Linux/macOS) - base_git_config = ( - f'git config --global user.name "{self.git_user_name}" && ' + INIT_COMMANDS.append( + f'git config --global user.name "{self.git_user_name}"' + ) + INIT_COMMANDS.append( f'git config --global user.email "{self.git_user_email}"' ) - INIT_COMMANDS.append(base_git_config) # Determine no-pager command if is_windows: