From 841f25343472339839c504bbb808b5aced29a263 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Wed, 19 May 2021 11:25:46 -0700 Subject: [PATCH] ci: don't pollute git with remote branches --- ci/niv-cron.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/niv-cron.nix b/ci/niv-cron.nix index a1ea3b59..e44be78e 100644 --- a/ci/niv-cron.nix +++ b/ci/niv-cron.nix @@ -49,10 +49,11 @@ with lib; { chmod 0600 ~/.ssh/id_rsa fi + git init -q sources ${concatStringsSep "\n" (mapAttrsToList (source: spec: let update = "niv update ${source}"; - fetch = "timeout 30 git fetch -q --depth 1 ${spec.repo} ${spec.branch}:source-${source}"; - revision = "$(git show-ref -s source-${source})"; + fetch = "timeout 30 git -C sources fetch -q --depth 1 ${spec.repo} ${spec.branch}:source-${source}"; + revision = "$(git -C sources show-ref -s source-${source})"; isGit = hasPrefix "https://" spec.repo or ""; git = '' if ${fetch}; then