aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/populate
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2019-08-08 17:12:48 +0200
committerlassulus <lassulus@lassul.us>2019-08-08 17:12:48 +0200
commit8f44460003ae10f543ccb6a29f15b57e42ca3aad (patch)
tree4c9610f2fd913c2bf293bd1e4ebb521379bd55ae /pkgs/populate
parent14a54637ce53ac07aae5ff8bda9d411c0efd5823 (diff)
populate git: add fetchAlways optionv1.16.0
Diffstat (limited to 'pkgs/populate')
-rw-r--r--pkgs/populate/default.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/populate/default.nix b/pkgs/populate/default.nix
index ad70d2e..1367a50 100644
--- a/pkgs/populate/default.nix
+++ b/pkgs/populate/default.nix
@@ -66,9 +66,13 @@ let
hash=${quote source.ref}
if ! test "$(git log --format=%H -1)" = "$hash"; then
- if ! git log -1 "$hash" >/dev/null 2>&1; then
+ ${if source.fetchAlways then /* sh */ ''
git fetch origin
- fi
+ '' else /* sh */ ''
+ if ! git log -1 "$hash" >/dev/null 2>&1; then
+ git fetch origin
+ fi
+ ''}
git reset --hard "$hash" >&2
git submodule update --init --recursive
fi