Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(forge): update submodules after dependency checkout #7142

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions crates/forge/bin/cmd/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ impl Installer<'_> {
// checkout the tag if necessary
self.git_checkout(&dep, path, false)?;

trace!("updating dependency submodules recursively");
self.git.root(path).submodule_update(false, false, false, true, None::<PathBuf>)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer this if it compiles

Suggested change
self.git.root(path).submodule_update(false, false, false, true, None::<PathBuf>)?;
self.git.root(path).submodule_update(false, false, false, true, std::iter::empty::<PathBuf>())?;


// remove git artifacts
fs::remove_dir_all(path.join(".git"))?;

Expand All @@ -259,6 +262,9 @@ impl Installer<'_> {
// checkout the tag if necessary
self.git_checkout(&dep, path, true)?;

trace!("updating dependency submodules recursively");
self.git.root(path).submodule_update(false, false, false, true, None::<PathBuf>)?;

if !self.no_commit {
self.git.add(Some(path))?;
}
Expand Down Expand Up @@ -315,10 +321,7 @@ impl Installer<'_> {
let path = path.strip_prefix(self.git.root).unwrap();

trace!(?dep, url, ?path, "installing git submodule");
self.git.submodule_add(true, url, path)?;

trace!("initializing submodule recursively");
self.git.submodule_update(false, false, false, true, Some(path))
self.git.submodule_add(true, url, path)
}

fn git_checkout(self, dep: &Dependency, path: &Path, recurse: bool) -> Result<String> {
Expand Down
Loading