Skip to content

Commit

Permalink
Only update src/llvm-project submodule if already existing
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Aug 25, 2024
1 parent a60a9e5 commit 29886a3
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2738,12 +2738,17 @@ impl Config {
return false;
}

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

// Check for untracked changes in `src/llvm-project`.
let has_changes = self
.last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true)
.is_none();
let has_changes = if !is_tracked_git_submodule {
false
} else {
self.update_submodule("src/llvm-project");
self.last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true).is_none()
};

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

0 comments on commit 29886a3

Please sign in to comment.