aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-04-11 11:14:10 +0200
committerGitHub <noreply@github.com>2022-04-11 11:14:10 +0200
commit2311868aaa1743e6dbe4ad18c7e63262cf87fe72 (patch)
treee11871ce8989c06fad19299a4ed7711eb6efd2ab
parent734019ce561951caff31365ee928603afdef450e (diff)
parent770f7371f33a56f7214001981a698113477ccec4 (diff)
Merge pull request #6391 from danpls/replace-regex
libfetchers: Replace regex to clarify intent
-rw-r--r--src/libfetchers/git.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libfetchers/git.cc b/src/libfetchers/git.cc
index f8433bc28..91dd332a2 100644
--- a/src/libfetchers/git.cc
+++ b/src/libfetchers/git.cc
@@ -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