diff --git a/common/remote/hooks/git/gitfile.cpp b/common/remote/hooks/git/gitfile.cpp index ccebaddb28b..702a0ab2f3b 100644 --- a/common/remote/hooks/git/gitfile.cpp +++ b/common/remote/hooks/git/gitfile.cpp @@ -236,9 +236,14 @@ class GitRepositoryFileIO : implements CSimpleInterfaceOf //If fetching from git and the username is specified then use the script file to provide the username/password //Only support retrieving the password as a secret - not as a filename + //NB: This code should be kept in sync with runGitCommand() in hqlrepository.cpp (and ideally combined) if (!isEmptyString(gitUser)) { + env.emplace_back("HPCC_GIT_USERNAME", gitUser); + + // If gituser is specified never prompt for credentials, otherwise the server can hang. env.emplace_back("GIT_TERMINAL_PROMPT", "0"); + StringBuffer scriptPath; getPackageFolder(scriptPath); addPathSepChar(scriptPath).append("bin/hpccaskpass.sh"); diff --git a/ecl/hql/hqlrepository.cpp b/ecl/hql/hqlrepository.cpp index 4a6ad7e5b75..7b7bf395085 100644 --- a/ecl/hql/hqlrepository.cpp +++ b/ecl/hql/hqlrepository.cpp @@ -937,6 +937,7 @@ unsigned EclRepositoryManager::runGitCommand(StringBuffer * output, const char * Owned extractedKey; EnvironmentVector env; //If fetching from git and the username is specified then use the script file to provide the username/password + //NB: This code should be kept in sync with readLfsContents() in gitfile.cpp (and ideally combined) if (needCredentials) { //If the username is supplied, then get the secret and write it to a temporary location.