1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Use git+ prefix in flake URI schemes

Fixes #3045.
This commit is contained in:
Eelco Dolstra 2019-09-05 17:15:09 +02:00
parent 6f88fed819
commit 2fa7f2a56a
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 36 additions and 26 deletions

View file

@ -25,6 +25,8 @@ GitInfo exportGit(ref<Store> store, std::string uri,
{
assert(!rev || rev->type == htSHA1);
if (hasPrefix(uri, "git+")) uri = std::string(uri, 4);
bool isLocal = hasPrefix(uri, "/") && pathExists(uri + "/.git");
// If this is a local directory (but not a file:// URI) and no ref