From cbc216911dbda23c3bc050c969bc725fe60760ef Mon Sep 17 00:00:00 2001
From: Shea Levy <shea@shealevy.com>
Date: Mon, 16 Oct 2017 13:25:24 -0400
Subject: [PATCH] fetchgit: Remove incomplete/unneeded ref check.

This check fails for tags and branches, and is made redundant by the
checks git itself will do when fetching the repo.
---
 src/libexpr/primops/fetchgit.cc | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/libexpr/primops/fetchgit.cc b/src/libexpr/primops/fetchgit.cc
index 545954f58..9db4adbc9 100644
--- a/src/libexpr/primops/fetchgit.cc
+++ b/src/libexpr/primops/fetchgit.cc
@@ -19,11 +19,6 @@ Path exportGit(ref<Store> store, const std::string & uri,
             throw Error("invalid Git revision '%s'", rev);
     }
 
-    // FIXME: too restrictive, but better safe than sorry.
-    std::regex refRegex("^[0-9a-zA-Z][0-9a-zA-Z.-]+$");
-    if (!std::regex_match(ref, refRegex))
-        throw Error("invalid Git ref '%s'", ref);
-
     Path cacheDir = getCacheDir() + "/nix/git";
 
     if (!pathExists(cacheDir)) {
-- 
GitLab