about summary refs log tree commit diff
path: root/pkgs/build-support/fetchgit
diff options
context:
space:
mode:
authorFelix Buehler <account@buehler.rocks>2023-02-06 21:49:02 +0100
committerFelix Buehler <account@buehler.rocks>2023-02-13 21:52:34 +0100
commitcdb39a86e0dd7cda3a057f4f4795485a5c9b9be5 (patch)
tree1fef6e55f39dab2289b68b68972ee4c9b89520f7 /pkgs/build-support/fetchgit
parent7f610b4d3f6e6f695b1f5521862066c0ece79a5a (diff)
treewide: use optionalString
Diffstat (limited to 'pkgs/build-support/fetchgit')
-rw-r--r--pkgs/build-support/fetchgit/default.nix4
1 files changed, 1 insertions, 3 deletions
diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix
index 2d0b4b20ef8b7..56973f5d3678a 100644
--- a/pkgs/build-support/fetchgit/default.nix
+++ b/pkgs/build-support/fetchgit/default.nix
@@ -7,9 +7,7 @@
 
     short = builtins.substring 0 7 rev;
 
-    appendShort = if (builtins.match "[a-f0-9]*" rev) != null
-      then "-${short}"
-      else "";
+    appendShort = lib.optionalString ((builtins.match "[a-f0-9]*" rev) != null) "-${short}";
   in "${if matched == null then base else builtins.head matched}${appendShort}";
 in
 { url, rev ? "HEAD", md5 ? "", sha256 ? "", hash ? "", leaveDotGit ? deepClone