aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-02-12 22:06:19 +0100
committerEelco Dolstra <edolstra@gmail.com>2019-02-12 22:06:19 +0100
commite38ec77de8077658d2f75fd6ff8b0f0f06babda9 (patch)
tree48f1ed2f0c8dfd60c55f2fcab8779cf6e02ac93c
parentbeab05851bfa895fe538f15f8bbb2da3a20db638 (diff)
Interpret all file:// URIs as Git repositories
-rw-r--r--src/libexpr/primops/flakeref.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libexpr/primops/flakeref.cc b/src/libexpr/primops/flakeref.cc
index 639313f21..a2700f102 100644
--- a/src/libexpr/primops/flakeref.cc
+++ b/src/libexpr/primops/flakeref.cc
@@ -79,7 +79,9 @@ FlakeRef::FlakeRef(const std::string & uri)
data = d;
}
- else if (std::regex_match(uri.c_str(), match, uriRegex) && hasSuffix(match[4], ".git")) {
+ else if (std::regex_match(uri.c_str(), match, uriRegex)
+ && (match[2] == "file" || hasSuffix(match[4], ".git")))
+ {
IsGit d;
d.uri = match[1];
for (auto & param : tokenizeString<Strings>(match[5], "&")) {