fetchgit: Add support for specifying branch name

This is useful when `leaveDotGit = true` and some other derivation
expects some branch name to exist.

Previously, `nix-prefetch-git` always created a branch with a
hard-coded name (`fetchgit`).
This commit is contained in:
Ricardo M. Correia
2015-04-21 19:46:29 +02:00
parent b1b4092ad5
commit c55c7e1c1e
3 changed files with 13 additions and 5 deletions
+2 -1
View File
@@ -13,6 +13,7 @@
in
{ url, rev ? "HEAD", md5 ? "", sha256 ? "", leaveDotGit ? deepClone
, fetchSubmodules ? true, deepClone ? false
, branchName ? null
, name ? urlToName url rev
}:
@@ -51,7 +52,7 @@ stdenv.mkDerivation {
outputHashMode = "recursive";
outputHash = if sha256 == "" then md5 else sha256;
inherit url rev leaveDotGit fetchSubmodules deepClone;
inherit url rev leaveDotGit fetchSubmodules deepClone branchName;
GIT_SSL_CAINFO = "${cacert}/etc/ca-bundle.crt";