From 827deaf1bf7aab7ee94ca5e56125dedb68a1bf33 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Fri, 27 Sep 2024 02:08:35 +0200 Subject: [PATCH] git: do not validate submodules of fresh checkouts Fixes #14603 --- src/cargo/sources/git/utils.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index 844a4dcf58b..031c3706439 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -181,9 +181,13 @@ impl GitDatabase { .filter(|co| co.is_fresh()) { Some(co) => co, - None => GitCheckout::clone_into(dest, self, rev, gctx)?, + None => { + let checkout = GitCheckout::clone_into(dest, self, rev, gctx)?; + checkout.update_submodules(gctx)?; + checkout + } }; - checkout.update_submodules(gctx)?; + Ok(checkout) }