Skip to content

Commit cc15e58

Browse files
committed
fix(fetchers/git): dont fetch shallow by default
1 parent 3f10812 commit cc15e58

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

lib/internal/fetchers/git/default.nix

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ in {
2222
url,
2323
rev,
2424
submodules ? true,
25+
shallow ? false,
2526
...
2627
} @ inp: let
27-
isRevGitRef = isGitRef rev;
28+
isRevGitRef = isGitRef rev != null;
2829
hasGitRef = inp.ref or null != null;
2930
in
30-
if isRevGitRef == null && isGitRev rev == null
31+
if ! isRevGitRef && isGitRev rev == null
3132
then
3233
throw ''
3334
invalid git rev: ${rev}
@@ -47,7 +48,7 @@ in {
4748
if hasGitRef
4849
then {inherit (inp) rev ref;}
4950
# otherwise check if the rev is a ref, if it is add to ref
50-
else if isRevGitRef != null
51+
else if isRevGitRef
5152
then {ref = inp.rev;}
5253
# if the rev isn't a ref, then it is a rev, so add it there
5354
else {rev = inp.rev;};
@@ -57,9 +58,8 @@ in {
5758
(b.fetchGit
5859
(refAndRev
5960
// {
60-
inherit url submodules;
61+
inherit url submodules shallow;
6162
# disable fetching all refs if the source specifies a ref
62-
shallow = true;
6363
allRefs = ! hasGitRef;
6464
}));
6565

@@ -74,8 +74,7 @@ in {
7474
b.fetchGit
7575
(refAndRev
7676
// {
77-
inherit url submodules;
78-
shallow = true;
77+
inherit url submodules shallow;
7978
allRefs = ! hasGitRef;
8079
})
8180
else

0 commit comments

Comments
 (0)