Skip to content

Commit

Permalink
Fix compilation of git.cpp in non-SFTP build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarod42 committed Dec 28, 2024
1 parent e719db2 commit db9a9b3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions git/git.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,9 @@ void GitPlugin::OnFilesRemovedFromProject(clCommandEvent& e)
void GitPlugin::ClearCodeLiteRemoteInfo()
{
m_isRemoteWorkspace = false;
#if USE_SFTP
m_ssh.reset();
#endif
m_remoteWorkspaceAccount.clear();
m_remoteProcess.Stop();
m_codeliteRemoteScriptPath.clear();
Expand Down Expand Up @@ -2718,15 +2720,9 @@ bool GitPlugin::DoExecuteCommandSync(const wxString& command, wxString* commandO
}

} else {
clEnvList_t env;
#if USE_SFTP
wxString git_command = "git --no-pager ";
git_command << command;
auto cb = [commandOutput](const std::string& output, clRemoteCommandStatus status) { *commandOutput = output; };
auto args = StringUtils::BuildCommandArrayFromString(git_command);

clDEBUG() << "Git (remote)->" << args << endl;
std::vector<wxString> vArgs{ args.begin(), args.end() };

auto output =
clSSHChannel::Execute(m_ssh, git_command, workingDir.empty() ? m_repositoryDirectory : workingDir);
if (!output.has_value()) {
Expand All @@ -2735,6 +2731,7 @@ bool GitPlugin::DoExecuteCommandSync(const wxString& command, wxString* commandO

clDEBUG() << "<-" << output.value() << endl;
*commandOutput = output.value();
#endif
}

const wxString lcOutput = commandOutput->Lower();
Expand Down

0 comments on commit db9a9b3

Please sign in to comment.