mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Set LC_ALL=C
for git when checking git worktree (#13637)
## Summary Closes #13612 We check if the git error message includes `not a git repository` to figure out if the path isn't a Git repo or if Git's broken. This PR sets `LC_ALL=C` when invoking `git rev-parse --is-inside-work-tree` so that the error message doesn’t change based on the user’s locale settings.
This commit is contained in:
parent
0ddcc19055
commit
bef128892d
1 changed files with 2 additions and 0 deletions
|
@ -24,6 +24,7 @@ use uv_python::{
|
|||
use uv_resolver::RequiresPython;
|
||||
use uv_scripts::{Pep723Script, ScriptTag};
|
||||
use uv_settings::PythonInstallMirrors;
|
||||
use uv_static::EnvVars;
|
||||
use uv_warnings::warn_user_once;
|
||||
use uv_workspace::pyproject_mut::{DependencyTarget, PyProjectTomlMut};
|
||||
use uv_workspace::{DiscoveryOptions, MemberDiscovery, Workspace, WorkspaceCache, WorkspaceError};
|
||||
|
@ -1235,6 +1236,7 @@ fn detect_git_repository(path: &Path) -> GitDiscoveryResult {
|
|||
let Ok(output) = Command::new(git)
|
||||
.arg("rev-parse")
|
||||
.arg("--is-inside-work-tree")
|
||||
.env(EnvVars::LC_ALL, "C")
|
||||
.current_dir(path)
|
||||
.output()
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue