update git ask pass for linux

This commit is contained in:
Roy Qu 2022-02-26 19:36:18 +08:00
parent 6a622f907e
commit 030486ef01
2 changed files with 7 additions and 4 deletions

View File

@ -587,11 +587,14 @@ QString GitManager::runGit(const QString& workingFolder, const QStringList &args
// qDebug()<<"---------"; // qDebug()<<"---------";
// qDebug()<<args; // qDebug()<<args;
QProcessEnvironment env; QProcessEnvironment env;
env.insert("PATH",pSettings->dirs().appDir());
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
env.insert("PATH",pSettings->dirs().appDir());
env.insert("GIT_ASKPASS",includeTrailingPathDelimiter(pSettings->dirs().appDir())+"redpanda-win-git-askpass.exe"); env.insert("GIT_ASKPASS",includeTrailingPathDelimiter(pSettings->dirs().appDir())+"redpanda-win-git-askpass.exe");
#else #elif defined(Q_OS_LINUX)
env.insert("GIT_ASKPASS",includeTrailingPathDelimiter(pSettings->dirs().appDir())+"redpanda-git-askpass.exe"); env.insert(QProcessEnvironment::systemEnvironment());
env.insert("LANG","en");
env.insert("LANGUAGE","en");
env.insert("GIT_ASKPASS",includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+"redpanda-git-askpass");
#endif #endif
QString output = runAndGetOutput( QString output = runAndGetOutput(
fileInfo.absoluteFilePath(), fileInfo.absoluteFilePath(),

View File

@ -11,7 +11,7 @@ int main(int argc, char *argv[])
Dialog w; Dialog w;
if (w.showPrompt(argv[1])==QDialog::Accepted) { if (w.showPrompt(argv[1])==QDialog::Accepted) {
char* input = w.getInput().toLocal8Bit().data(); char* input = w.getInput().toLocal8Bit().data();
printf(input); printf("%s",input);
} }
} }
return 0; return 0;