From 030486ef01a9e680ea1d50c92b1c39916ec0bfe7 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 26 Feb 2022 19:36:18 +0800 Subject: [PATCH] update git ask pass for linux --- RedPandaIDE/vcs/gitmanager.cpp | 9 ++++++--- redpanda-git-askpass/main.cpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/RedPandaIDE/vcs/gitmanager.cpp b/RedPandaIDE/vcs/gitmanager.cpp index a559cde8..48e76915 100644 --- a/RedPandaIDE/vcs/gitmanager.cpp +++ b/RedPandaIDE/vcs/gitmanager.cpp @@ -587,11 +587,14 @@ QString GitManager::runGit(const QString& workingFolder, const QStringList &args // qDebug()<<"---------"; // qDebug()<dirs().appDir()); #ifdef Q_OS_WIN + env.insert("PATH",pSettings->dirs().appDir()); env.insert("GIT_ASKPASS",includeTrailingPathDelimiter(pSettings->dirs().appDir())+"redpanda-win-git-askpass.exe"); -#else - env.insert("GIT_ASKPASS",includeTrailingPathDelimiter(pSettings->dirs().appDir())+"redpanda-git-askpass.exe"); +#elif defined(Q_OS_LINUX) + env.insert(QProcessEnvironment::systemEnvironment()); + env.insert("LANG","en"); + env.insert("LANGUAGE","en"); + env.insert("GIT_ASKPASS",includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"redpanda-git-askpass"); #endif QString output = runAndGetOutput( fileInfo.absoluteFilePath(), diff --git a/redpanda-git-askpass/main.cpp b/redpanda-git-askpass/main.cpp index f67f6ad8..95f2bdf6 100644 --- a/redpanda-git-askpass/main.cpp +++ b/redpanda-git-askpass/main.cpp @@ -11,7 +11,7 @@ int main(int argc, char *argv[]) Dialog w; if (w.showPrompt(argv[1])==QDialog::Accepted) { char* input = w.getInput().toLocal8Bit().data(); - printf(input); + printf("%s",input); } } return 0;