Skip to content
Snippets Groups Projects
Commit be59f077 authored by Eelco Dolstra's avatar Eelco Dolstra Committed by GitHub
Browse files

Merge pull request #1601 from shlevy/fetchgit-no-uri-check

fetchgit: Remove incomplete/unneeded isURI check.
parents 1dd29d7a 4e58294a
No related branches found
No related tags found
No related merge requests found
...@@ -13,9 +13,6 @@ namespace nix { ...@@ -13,9 +13,6 @@ namespace nix {
Path exportGit(ref<Store> store, const std::string & uri, Path exportGit(ref<Store> store, const std::string & uri,
const std::string & ref, const std::string & rev) const std::string & ref, const std::string & rev)
{ {
if (!isUri(uri))
throw EvalError(format("'%s' is not a valid URI") % uri);
if (rev != "") { if (rev != "") {
std::regex revRegex("^[0-9a-fA-F]{40}$"); std::regex revRegex("^[0-9a-fA-F]{40}$");
if (!std::regex_match(rev, revRegex)) if (!std::regex_match(rev, revRegex))
...@@ -47,7 +44,7 @@ Path exportGit(ref<Store> store, const std::string & uri, ...@@ -47,7 +44,7 @@ Path exportGit(ref<Store> store, const std::string & uri,
if (stat(localRefFile.c_str(), &st) != 0 || if (stat(localRefFile.c_str(), &st) != 0 ||
st.st_mtime < now - settings.tarballTtl) st.st_mtime < now - settings.tarballTtl)
{ {
runProgram("git", true, { "-C", cacheDir, "fetch", "--force", uri, ref + ":" + localRef }); runProgram("git", true, { "-C", cacheDir, "fetch", "--force", "--", uri, ref + ":" + localRef });
struct timeval times[2]; struct timeval times[2];
times[0].tv_sec = now; times[0].tv_sec = now;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment