From 600e1b99879d9eb266a639c9bafffa2aaeaf67ba Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 31 Mar 2021 16:38:09 +0200 Subject: [PATCH] tools: add helper function to find the git commit --- garlic/tools.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/garlic/tools.nix b/garlic/tools.nix index db9c2a7..666f12e 100644 --- a/garlic/tools.nix +++ b/garlic/tools.nix @@ -85,6 +85,11 @@ let in toInt front; + # Returns the given gitCommit if not null, or the one stored in the + # gitTable for the branch gitBranch. + findCommit = {gitCommit ? null, gitTable, gitBranch}: + if (gitCommit != null) then gitCommit else gitTable."${gitBranch}"; + }; in gen