Skip to content

Commit

Permalink
fix(turborepo): Optional lock with env var (#8247)
Browse files Browse the repository at this point in the history
### Description

#8244 broke main, since apparently the `--no-optional-lock` flag was
introduced relatively recently. Instead, we pass an env variable
through.

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->
  • Loading branch information
NicholasLYang committed May 29, 2024
1 parent 244ca6f commit 1911215
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/turborepo-scm/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl Git {
command
.args(args)
.current_dir(&self.root)
.env("GIT_OPTIONAL_LOCKS", "false");
.env("GIT_OPTIONAL_LOCKS", "0");

if !pathspec.is_empty() {
command.arg("--").arg(pathspec);
Expand Down
3 changes: 2 additions & 1 deletion crates/turborepo-scm/src/ls_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ impl Git {
pub fn git_ls_tree(&self, root_path: &AbsoluteSystemPathBuf) -> Result<GitHashes, Error> {
let mut hashes = GitHashes::new();
let mut git = Command::new(self.bin.as_std_path())
.args(["ls-tree", "--no-optional-locks", "-r", "-z", "HEAD"])
.args(["ls-tree", "-r", "-z", "HEAD"])
.env("GIT_OPTIONAL_LOCKS", "0")
.current_dir(root_path)
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-scm/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ impl Git {
let mut git = Command::new(self.bin.as_std_path())
.args([
"status",
"--no-optional-locks",
"--untracked-files",
"--no-renames",
"-z",
"--",
".",
])
.env("GIT_OPTIONAL_LOCKS", "0")
.current_dir(root_path)
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand Down

0 comments on commit 1911215

Please sign in to comment.