Skip to content

Commit

Permalink
Skip submodule update for fresh clones (#4482)
Browse files Browse the repository at this point in the history
## Summary

We unconditionally update the submodules in our Git code, but AFAICT it
shouldn't be necessary if we already have a complete, up-to-date fetch
available.
  • Loading branch information
charliermarsh authored Jun 24, 2024
1 parent 01515c1 commit 7d3fb43
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions crates/uv-git/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ impl GitDatabase {
Some(co) => co,
None => GitCheckout::clone_into(destination, self, rev)?,
};
checkout.update_submodules()?;
Ok(checkout)
}

Expand Down Expand Up @@ -414,20 +413,18 @@ impl GitCheckout {
.cwd(&self.repo.path)
.exec_with_output()?;

paths::create(ok_file)?;
Ok(())
}

/// Runs `git submodule update --recursive` on this git checkout.
fn update_submodules(&self) -> Result<()> {
// Update submodules (`git submodule update --recursive`).
ProcessBuilder::new("git")
.arg("submodule")
.arg("update")
.arg("--recursive")
.arg("--init")
.cwd(&self.repo.path)
.exec_with_output()
.map(drop)
.map(drop)?;

paths::create(ok_file)?;
Ok(())
}
}

Expand Down

0 comments on commit 7d3fb43

Please sign in to comment.