aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libfetchers/github.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libfetchers/github.cc b/src/libfetchers/github.cc
index d52ea649d..58b6e7c04 100644
--- a/src/libfetchers/github.cc
+++ b/src/libfetchers/github.cc
@@ -399,7 +399,9 @@ struct SourceHutInputScheme : GitArchiveInputScheme
std::string line;
std::string id;
while(getline(is, line)) {
- std::regex pattern(ref_uri);
+ // Append $ to avoid partial name matches
+ std::regex pattern(fmt("%s$", ref_uri));
+
if (std::regex_search(line, pattern)) {
id = line.substr(0, line.find('\t'));
break;