File tree 2 files changed +14
-9
lines changed
2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -2509,6 +2509,18 @@ impl Config {
2509
2509
}
2510
2510
}
2511
2511
2512
+ /// Updates the given submodule only if it's initialized already; nothing happens otherwise.
2513
+ pub ( crate ) fn update_existing_submodule ( & self , submodule : & str ) {
2514
+ // Avoid running git when there isn't a git checkout.
2515
+ if !self . submodules ( ) {
2516
+ return ;
2517
+ }
2518
+
2519
+ if GitInfo :: new ( false , Path :: new ( submodule) ) . is_managed_git_subrepository ( ) {
2520
+ self . update_submodule ( submodule) ;
2521
+ }
2522
+ }
2523
+
2512
2524
/// Given a path to the directory of a submodule, update it.
2513
2525
///
2514
2526
/// `relative_path` should be relative to the root of the git repository, not an absolute path.
@@ -2738,7 +2750,7 @@ impl Config {
2738
2750
return false ;
2739
2751
}
2740
2752
2741
- self . update_submodule ( "src/llvm-project" ) ;
2753
+ self . update_existing_submodule ( "src/llvm-project" ) ;
2742
2754
2743
2755
// Check for untracked changes in `src/llvm-project`.
2744
2756
let has_changes = self
Original file line number Diff line number Diff line change @@ -542,14 +542,7 @@ impl Build {
542
542
543
543
/// Updates the given submodule only if it's initialized already; nothing happens otherwise.
544
544
pub fn update_existing_submodule ( & self , submodule : & str ) {
545
- // Avoid running git when there isn't a git checkout.
546
- if !self . config . submodules ( ) {
547
- return ;
548
- }
549
-
550
- if GitInfo :: new ( false , Path :: new ( submodule) ) . is_managed_git_subrepository ( ) {
551
- self . config . update_submodule ( submodule) ;
552
- }
545
+ self . config . update_existing_submodule ( submodule)
553
546
}
554
547
555
548
/// Executes the entire build, as configured by the flags and configuration.
You can’t perform that action at this time.
0 commit comments