about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWaffle Lapkin <waffle.lapkin@gmail.com>2025-04-14 18:24:30 +0200
committerWaffle Lapkin <waffle.lapkin@gmail.com>2025-04-15 09:42:25 +0200
commitfc8df06f4feb6cc051e15e6596821d276b0797bb (patch)
treeeee135d2334004740aa92ca9b43bc51977ebb01b
parent2da29dbe8fe23df1c7c4ab1d8740ca3c32b15526 (diff)
downloadrust-fc8df06f4feb6cc051e15e6596821d276b0797bb.tar.gz
rust-fc8df06f4feb6cc051e15e6596821d276b0797bb.zip
update submodules if the directory doesn't exist
-rw-r--r--src/bootstrap/src/core/config/config.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 25ec64f90b5..2266e61bf60 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -2888,6 +2888,13 @@ impl Config {
 
         let absolute_path = self.src.join(relative_path);
 
+        // NOTE: This check is required because `jj git clone` doesn't create directories for
+        // submodules, they are completely ignored. The code below assumes this directory exists,
+        // so create it here.
+        if !absolute_path.exists() {
+            t!(fs::create_dir_all(&absolute_path));
+        }
+
         // NOTE: The check for the empty directory is here because when running x.py the first time,
         // the submodule won't be checked out. Check it out now so we can build it.
         if !GitInfo::new(false, &absolute_path).is_managed_git_subrepository()