Skip to content

Commit 5a651e8

Browse files
author
Shay Bergmann
committed
Use lib.pathIsGitRepo
instead of just checking for the existence of `.git`. It covers more cases that way.
1 parent 992196d commit 5a651e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

nix/pkgs/mantis/default.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
mkSrc = src:
44
let
5-
isGit = builtins.pathExists (src + "/.git");
5+
isGit = lib.pathIsGitRepo (src + "/.git");
66
repo = builtins.fetchGit { url = src; submodules = true; };
77
dirty = repo.revCount == 0;
88
filterSrc = src:
99
lib.cleanSourceWith {
1010
inherit src;
1111
filter = path: _: !lib.hasSuffix "nix" path;
1212
};
13-
in if isGit then
13+
in
14+
if isGit then
1415
if dirty then filterSrc (gitignoreSource src) else repo
1516
else
1617
src;

0 commit comments

Comments
 (0)