Skip to content

Commit

Permalink
Auto merge of #13935 - Urgau:local-independent-git-test, r=epage
Browse files Browse the repository at this point in the history
Make `git::use_the_cli` test truly locale independent

### What does this PR try to resolve?

The current `git::use_the_cli` test part the output of Git but that output is locale dependant, making it fail on my non-english system.

Specifically this part of the test is local-dependent:
```
From [..]
 * [new ref] [..] -> origin/HEAD[..]
```

Adding the `LC_ALL=C` env to the cargo invocation solve the issue, making the test locale independent.

### How should we test and review this PR?

Trying putting a different `LC_ALL` locale and the test will fail without this PR and will not fail with my PR.
  • Loading branch information
bors committed May 20, 2024
2 parents c256d74 + 8fdac92 commit 2332d7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/testsuite/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2831,7 +2831,11 @@ From [..]
[FINISHED] [..]
";

project.cargo("check -v").with_stderr(stderr).run();
project
.cargo("check -v")
.env("LC_ALL", "C")
.with_stderr(stderr)
.run();
assert!(paths::home().join(".cargo/git/CACHEDIR.TAG").is_file());
}

Expand Down

0 comments on commit 2332d7a

Please sign in to comment.