Skip to content

Commit 8690fef

Browse files
authored
fix(forge): run git submodule sync when installing (#10347)
1 parent 1ae64e3 commit 8690fef

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

crates/cli/src/utils/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,10 @@ ignore them in the `.gitignore` file."
575575
self.cmd().stderr(self.stderr()).args(["submodule", "init"]).exec().map(drop)
576576
}
577577

578+
pub fn submodule_sync(self) -> Result<()> {
579+
self.cmd().stderr(self.stderr()).args(["submodule", "sync"]).exec().map(drop)
580+
}
581+
578582
pub fn cmd(self) -> Command {
579583
let mut cmd = Self::cmd_no_root();
580584
cmd.current_dir(self.root);

crates/forge/src/cmd/install.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ impl Installer<'_> {
276276
std::iter::empty::<PathBuf>(),
277277
)?;
278278

279+
// sync submodules config with changes in .gitmodules, see <https://github.com/foundry-rs/foundry/issues/9611>
280+
self.git.root(path).submodule_sync()?;
281+
279282
if self.commit {
280283
self.git.add(Some(path))?;
281284
}

0 commit comments

Comments
 (0)