Skip to content

Commit

Permalink
shallow clones: fetch tags shallowly too
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
alt-romes committed Dec 18, 2024
1 parent 9ea6d4e commit a19c6e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cabal-install/src/Distribution/Client/VCS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down

0 comments on commit a19c6e3

Please sign in to comment.