Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 922fdd8

Browse files
committed
Remove argument from the submodules method
The argument was not necessary, since it was only ever passed one value that exists in the config itself.
1 parent 2c6222b commit 922fdd8

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,8 +2404,11 @@ impl Config {
24042404
.unwrap_or_else(|| SplitDebuginfo::default_for_platform(target))
24052405
}
24062406

2407-
pub fn submodules(&self, rust_info: &GitInfo) -> bool {
2408-
self.submodules.unwrap_or(rust_info.is_managed_git_subrepository())
2407+
/// Returns whether or not submodules should be managed by bootstrap.
2408+
pub fn submodules(&self) -> bool {
2409+
// If not specified in config, the default is to only manage
2410+
// submodules if we're currently inside a git repository.
2411+
self.submodules.unwrap_or(self.rust_info.is_managed_git_subrepository())
24092412
}
24102413

24112414
pub fn codegen_backends(&self, target: TargetSelection) -> &[String] {

src/bootstrap/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ impl Build {
475475
///
476476
/// `relative_path` should be relative to the root of the git repository, not an absolute path.
477477
pub(crate) fn update_submodule(&self, relative_path: &Path) {
478-
if !self.config.submodules(self.rust_info()) {
478+
if !self.config.submodules() {
479479
return;
480480
}
481481

@@ -585,7 +585,7 @@ impl Build {
585585
fn update_existing_submodules(&self) {
586586
// Avoid running git when there isn't a git checkout, or the user has
587587
// explicitly disabled submodules in `config.toml`.
588-
if !self.config.submodules(self.rust_info()) {
588+
if !self.config.submodules() {
589589
return;
590590
}
591591
let output = helpers::git(Some(&self.src))
@@ -609,7 +609,7 @@ impl Build {
609609
/// Updates the given submodule only if it's initialized already; nothing happens otherwise.
610610
pub fn update_existing_submodule(&self, submodule: &Path) {
611611
// Avoid running git when there isn't a git checkout.
612-
if !self.config.submodules(self.rust_info()) {
612+
if !self.config.submodules() {
613613
return;
614614
}
615615

0 commit comments

Comments
 (0)