summary refs log tree commit diff
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-06-18 11:30:31 +0200
committerGitHub <noreply@github.com>2021-06-18 11:30:31 +0200
commit2685bda65792a4f57617f561b16280cb15ce27d4 (patch)
treeb7149f3b9063f98d1229b622a98e126144d1f8ad
parentc419ced74d36ae760f48fe3aad48f5be66d0f527 (diff)
parent6c876bac617bc8bfda67891d320d8e34d24a2a7e (diff)
downloadnixpkgs-2685bda65792a4f57617f561b16280cb15ce27d4.tar
nixpkgs-2685bda65792a4f57617f561b16280cb15ce27d4.tar.gz
nixpkgs-2685bda65792a4f57617f561b16280cb15ce27d4.tar.bz2
nixpkgs-2685bda65792a4f57617f561b16280cb15ce27d4.tar.lz
nixpkgs-2685bda65792a4f57617f561b16280cb15ce27d4.tar.xz
nixpkgs-2685bda65792a4f57617f561b16280cb15ce27d4.tar.zst
nixpkgs-2685bda65792a4f57617f561b16280cb15ce27d4.zip
Merge pull request #119610 from attila-lendvai/updater
unstable-updater.nix now understands a branch argument
-rw-r--r--pkgs/common-updater/unstable-updater.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/common-updater/unstable-updater.nix b/pkgs/common-updater/unstable-updater.nix
index d315c1027ab..01f8ae2533e 100644
--- a/pkgs/common-updater/unstable-updater.nix
+++ b/pkgs/common-updater/unstable-updater.nix
@@ -1,4 +1,5 @@
-{ writeShellScript
+{ lib
+, writeShellScript
 , coreutils
 , git
 , nix
@@ -8,6 +9,7 @@
 # This is an updater for unstable packages that should always use the latest
 # commit.
 { url ? null # The git url, if empty it will be set to src.url
+, branch ? null
 }:
 
 let
@@ -25,7 +27,9 @@ let
 
     # Get info about HEAD from a shallow git clone
     tmpdir="$(${coreutils}/bin/mktemp -d)"
-    ${git}/bin/git clone --bare --depth=1 "$url" "$tmpdir"
+    ${git}/bin/git clone --bare --depth=1 \
+      ${lib.optionalString (branch != null) "--branch ${branch}"} \
+      "$url" "$tmpdir"
     pushd "$tmpdir"
     commit_date="$(${git}/bin/git show -s --pretty='format:%cs')"
     commit_sha="$(${git}/bin/git show -s --pretty='format:%H')"