aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/parser.y')
-rw-r--r--src/libexpr/parser.y13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 20ae1a696..776e5cb39 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -520,9 +520,10 @@ formal
#include <fcntl.h>
#include <unistd.h>
-#include <eval.hh>
-#include <download.hh>
-#include <store-api.hh>
+#include "eval.hh"
+#include "download.hh"
+#include "store-api.hh"
+#include "primops/fetchgit.hh"
namespace nix {
@@ -657,7 +658,11 @@ std::pair<bool, std::string> EvalState::resolveSearchPathElem(const SearchPathEl
if (isUri(elem.second)) {
try {
- res = { true, makeDownloader()->downloadCached(store, elem.second, true) };
+ if (hasPrefix(elem.second, "git://") || hasSuffix(elem.second, ".git"))
+ // FIXME: support specifying revision/branch
+ res = { true, exportGit(store, elem.second, "master") };
+ else
+ res = { true, makeDownloader()->downloadCached(store, elem.second, true) };
} catch (DownloadError & e) {
printMsg(lvlError, format("warning: Nix search path entry ‘%1%’ cannot be downloaded, ignoring") % elem.second);
res = { false, "" };