Merge pull request #6391 from danpls/replace-regex

libfetchers: Replace regex to clarify intent
This commit is contained in:
Eelco Dolstra 2022-04-11 11:14:10 +02:00 committed by GitHub
commit 2311868aaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,9 +28,7 @@ static std::string readHead(const Path & path)
static bool isNotDotGitDirectory(const Path & path)
{
static const std::regex gitDirRegex("^(?:.*/)?\\.git$");
return not std::regex_match(path, gitDirRegex);
return baseNameOf(path) != ".git";
}
struct GitInputScheme : InputScheme