mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-29 09:06:15 +02:00
Merge pull request #10811 from Mic92/fetcher-fix
libfetchers: handle nonexistent refs in GitLab repos more gracefully
This commit is contained in:
commit
962475d97f
1 changed files with 9 additions and 3 deletions
|
@ -433,9 +433,15 @@ struct GitLabInputScheme : GitArchiveInputScheme
|
||||||
store->toRealPath(
|
store->toRealPath(
|
||||||
downloadFile(store, url, "source", headers).storePath)));
|
downloadFile(store, url, "source", headers).storePath)));
|
||||||
|
|
||||||
return RefInfo {
|
if (json.is_array() && json.size() == 1 && json[0]["id"] != nullptr) {
|
||||||
.rev = Hash::parseAny(std::string(json[0]["id"]), HashAlgorithm::SHA1)
|
return RefInfo {
|
||||||
};
|
.rev = Hash::parseAny(std::string(json[0]["id"]), HashAlgorithm::SHA1)
|
||||||
|
};
|
||||||
|
} if (json.is_array() && json.size() == 0) {
|
||||||
|
throw Error("No commits returned by GitLab API -- does the git ref really exist?");
|
||||||
|
} else {
|
||||||
|
throw Error("Unexpected response received from GitLab: %s", json);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DownloadUrl getDownloadUrl(const Input & input) const override
|
DownloadUrl getDownloadUrl(const Input & input) const override
|
||||||
|
|
Loading…
Reference in a new issue