forked from lix-project/lix
git fetcher: set locale for rev-parse
This commit is contained in:
parent
9504445cab
commit
53523c0ab8
|
@ -220,11 +220,17 @@ struct GitInputScheme : InputScheme
|
||||||
if (!input.getRef() && !input.getRev() && isLocal) {
|
if (!input.getRef() && !input.getRev() && isLocal) {
|
||||||
bool clean = false;
|
bool clean = false;
|
||||||
|
|
||||||
|
auto env = getEnv();
|
||||||
|
// Set LC_ALL to C: because we rely on the error messages from git rev-parse to determine what went wrong
|
||||||
|
// that way unknown errors can lead to a failure instead of continuing through the wrong code path
|
||||||
|
env["LC_ALL"] = "C";
|
||||||
|
|
||||||
/* Check whether HEAD points to something that looks like a commit,
|
/* Check whether HEAD points to something that looks like a commit,
|
||||||
since that is the refrence we want to use later on. */
|
since that is the refrence we want to use later on. */
|
||||||
auto result = runProgram(RunOptions {
|
auto result = runProgram(RunOptions {
|
||||||
.program = "git",
|
.program = "git",
|
||||||
.args = { "-C", actualUrl, "--git-dir=.git", "rev-parse", "--verify", "--no-revs", "HEAD^{commit}" },
|
.args = { "-C", actualUrl, "--git-dir=.git", "rev-parse", "--verify", "--no-revs", "HEAD^{commit}" },
|
||||||
|
.environment = env,
|
||||||
.mergeStderrToStdout = true
|
.mergeStderrToStdout = true
|
||||||
});
|
});
|
||||||
auto exitCode = WEXITSTATUS(result.first);
|
auto exitCode = WEXITSTATUS(result.first);
|
||||||
|
|
Loading…
Reference in a new issue