From a19c6e3f5172b2fa0fb299d2f6b8a9513b0fc41e Mon Sep 17 00:00:00 2001 From: Rodrigo Mesquita Date: Wed, 18 Dec 2024 09:57:11 +0000 Subject: [PATCH] shallow clones: fetch tags shallowly too It turns out that git fetch origin tag will clone the full repository unless it is also given --depth=1 as an argument. This commit amends this oversight, ensuring source-repository-package stanzas with any tag don't have to fall back to fetch unnecessary information (which is coincidentally much faster) --- cabal-install/src/Distribution/Client/VCS.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cabal-install/src/Distribution/Client/VCS.hs b/cabal-install/src/Distribution/Client/VCS.hs index a7356d85a3b..10635384d10 100644 --- a/cabal-install/src/Distribution/Client/VCS.hs +++ b/cabal-install/src/Distribution/Client/VCS.hs @@ -583,7 +583,7 @@ vcsGit = -- -- Option 2 is what Cabal has done historically, and we're keeping it -- for now. Option 1 is possible but seems to have little benefit. - git localDir ("fetch" : verboseArg ++ ["origin", ref]) + git localDir ("fetch" : verboseArg ++ ["--depth=1", "origin", ref]) pure "FETCH_HEAD" Just ref | otherwise ->