Skip to content

Commit 29886a3

Browse files
committed
Only update src/llvm-project submodule if already existing
1 parent a60a9e5 commit 29886a3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,12 +2738,17 @@ impl Config {
27382738
return false;
27392739
}
27402740

2741-
self.update_submodule("src/llvm-project");
2741+
let is_tracked_git_submodule = self.submodules()
2742+
&& GitInfo::new(false, Path::new("src/llvm-project"))
2743+
.is_managed_git_subrepository();
27422744

27432745
// Check for untracked changes in `src/llvm-project`.
2744-
let has_changes = self
2745-
.last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true)
2746-
.is_none();
2746+
let has_changes = if !is_tracked_git_submodule {
2747+
false
2748+
} else {
2749+
self.update_submodule("src/llvm-project");
2750+
self.last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true).is_none()
2751+
};
27472752

27482753
// Return false if there are untracked changes, otherwise check if CI LLVM is available.
27492754
if has_changes { false } else { llvm::is_ci_llvm_available(self, asserts) }

0 commit comments

Comments
 (0)