Skip to content

Commit 2887fa9

Browse files
committed
fix: use relative work tree when running from root
When running a git command from the root of the work tree, just use "." for GIT_WORK_TREE instead of an absolute path. This is part of a general attempt to reduce the use of absolute paths in hopes of improving compatibility with Windows.
1 parent 71be816 commit 2887fa9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/stupid/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<'repo, 'index> StupidContext<'repo, 'index> {
105105
if let Some(git_dir) = self.git_dir {
106106
command.env("GIT_DIR", realpath(git_dir)?);
107107
}
108-
command.env("GIT_WORK_TREE", realpath(work_dir)?);
108+
command.env("GIT_WORK_TREE", ".");
109109
if let Some(index_path) = self.index_path {
110110
command.env("GIT_INDEX_FILE", realpath(index_path)?);
111111
}

0 commit comments

Comments
 (0)