mirror of
https://github.com/Dasemu/Grove.git
synced 2026-11-26 15:26:09 +00:00
feat(providers): get_repo to read one repo's visibility
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0884d556ce
commit
fc309f9b18
4 files changed
+55
No files matched your search
@@ -54,6 +54,17 @@ impl Provider for GitHub {
|
||||
.ok_or_else(|| Error::Other("response has no login".into()))
|
||||
}
|
||||
|
||||
fn get_repo(&self, owner: &str, name: &str) -> Result<RemoteRepo> {
|
||||
let v = self
|
||||
.http
|
||||
.ok("GET", &format!("/repos/{owner}/{name}"), None)?;
|
||||
// `repo` defaults a missing flag to public; for a visibility check that must be an error.
|
||||
if !v["private"].is_boolean() {
|
||||
return Err(Error::Other("response has no `private` flag".into()));
|
||||
}
|
||||
Ok(repo(&v))
|
||||
}
|
||||
|
||||
fn list_repos(&self) -> Result<Vec<RemoteRepo>> {
|
||||
let mut out = Vec::new();
|
||||
for page in 1..=200 {
|
||||
|
||||
Reference in new issue
Block a user