forked from lix-project/lix
Merge pull request #6290 from Misterio77/fix-sourcehut-tags-refs
Fix sourcehut tags refs resolving
This commit is contained in:
commit
7ed81701ee
|
@ -390,7 +390,7 @@ struct SourceHutInputScheme : GitArchiveInputScheme
|
||||||
|
|
||||||
ref_uri = line.substr(ref_index+5, line.length()-1);
|
ref_uri = line.substr(ref_index+5, line.length()-1);
|
||||||
} else
|
} else
|
||||||
ref_uri = fmt("refs/heads/%s", ref);
|
ref_uri = fmt("refs/(heads|tags)/%s", ref);
|
||||||
|
|
||||||
auto file = store->toRealPath(
|
auto file = store->toRealPath(
|
||||||
downloadFile(store, fmt("%s/info/refs", base_url), "source", false, headers).storePath);
|
downloadFile(store, fmt("%s/info/refs", base_url), "source", false, headers).storePath);
|
||||||
|
@ -399,9 +399,11 @@ struct SourceHutInputScheme : GitArchiveInputScheme
|
||||||
std::string line;
|
std::string line;
|
||||||
std::string id;
|
std::string id;
|
||||||
while(getline(is, line)) {
|
while(getline(is, line)) {
|
||||||
auto index = line.find(ref_uri);
|
// Append $ to avoid partial name matches
|
||||||
if (index != std::string::npos) {
|
std::regex pattern(fmt("%s$", ref_uri));
|
||||||
id = line.substr(0, index-1);
|
|
||||||
|
if (std::regex_search(line, pattern)) {
|
||||||
|
id = line.substr(0, line.find('\t'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ let
|
||||||
echo 'ref: refs/heads/master' > $out/HEAD
|
echo 'ref: refs/heads/master' > $out/HEAD
|
||||||
|
|
||||||
mkdir -p $out/info
|
mkdir -p $out/info
|
||||||
echo '${nixpkgs.rev} refs/heads/master' > $out/info/refs
|
echo -e '${nixpkgs.rev}\trefs/heads/master' > $out/info/refs
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in a new issue