about summary refs log tree commit diff
path: root/src/libexpr/primops/fetchgit.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-07-27T16·08+0200
committerEelco Dolstra <edolstra@gmail.com>2017-07-27T16·08+0200
commit7480f4f9a478d294eaa095c101df7c0543c1fd71 (patch)
tree0e4c3a5cac785ccc8f7d78beffeaea32b27744fd /src/libexpr/primops/fetchgit.hh
parent9f64cb89cbbd0cd0540ad99e3578b6cecd385a81 (diff)
builtins.fetchgit: Support specifying commit hashes
This adds an argument "rev" specififying the Git commit hash. The
existing argument "rev" is renamed to "ref". The default value for
"ref" is "master". When specifying a hash, it's necessary to specify a
ref since we're not cloning the entire repository but only fetching a
specific ref.

Example usage:

  builtins.fetchgit {
    url = https://github.com/NixOS/nixpkgs.git;
    ref = "release-16.03";
    rev = "c1c0484041ab6f9c6858c8ade80a8477c9ae4442";
  };
Diffstat (limited to '')
-rw-r--r--src/libexpr/primops/fetchgit.hh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/primops/fetchgit.hh b/src/libexpr/primops/fetchgit.hh
index 6ffb21a96daa..ff228f3b3c6a 100644
--- a/src/libexpr/primops/fetchgit.hh
+++ b/src/libexpr/primops/fetchgit.hh
@@ -8,7 +8,7 @@ namespace nix {
 
 class Store;
 
-Path exportGit(ref<Store> store,
-    const std::string & uri, const std::string & rev);
+Path exportGit(ref<Store> store, const std::string & uri,
+    const std::string & ref, const std::string & rev = "");
 
 }