Don't partial match sourcehut refs

This commit is contained in:
Gabriel Fontes 2022-03-19 11:04:04 -03:00
parent 345a8ee0cb
commit 9720797f69
No known key found for this signature in database
GPG key ID: 2E54EA7BFE630916

View file

@ -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;