Skip to content

Commit

Permalink
Ignore .bazel symlinks as well as bazel- symlinks (#3103)
Browse files Browse the repository at this point in the history
This is a reasonably common convention
  • Loading branch information
illicitonion authored Dec 14, 2024
1 parent f42004c commit bbbf343
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crate_universe/src/metadata/workspace_discoverer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn discover_workspaces_with_cache(
return true;
}
if let Some(file_name) = e.file_name().to_str() {
if file_name.starts_with("bazel-") {
if file_name.starts_with("bazel-") || file_name.starts_with(".bazel") {
return false;
}
}
Expand Down Expand Up @@ -279,12 +279,18 @@ mod test {
.unwrap();
let root_dir = Utf8PathBuf::from_path_buf(root_dir).unwrap();

let _symlink = DeleteOnDropDirSymlink::symlink(
let _symlink1 = DeleteOnDropDirSymlink::symlink(
Path::new("..").join("symlinked"),
root_dir.join("ws1").join("bazel-ws1").into_std_path_buf(),
)
.unwrap();

let _symlink2 = DeleteOnDropDirSymlink::symlink(
Path::new("..").join("symlinked"),
root_dir.join("ws1").join(".bazel").into_std_path_buf(),
)
.unwrap();

let expected = ws1_discovered_workspaces(&root_dir);

let actual = discover_workspaces(
Expand Down

0 comments on commit bbbf343

Please sign in to comment.