Skip to content

Commit a19c6e3

Browse files
committed
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)
1 parent 9ea6d4e commit a19c6e3

File tree

1 file changed

+1
-1
lines changed
  • cabal-install/src/Distribution/Client

1 file changed

+1
-1
lines changed

cabal-install/src/Distribution/Client/VCS.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ vcsGit =
583583
--
584584
-- Option 2 is what Cabal has done historically, and we're keeping it
585585
-- for now. Option 1 is possible but seems to have little benefit.
586-
git localDir ("fetch" : verboseArg ++ ["origin", ref])
586+
git localDir ("fetch" : verboseArg ++ ["--depth=1", "origin", ref])
587587
pure "FETCH_HEAD"
588588
Just ref
589589
| otherwise ->

0 commit comments

Comments
 (0)