aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2022-06-04 05:25:48 +0200
committerTeddy Wing2022-06-04 14:11:54 +0200
commit996426344348fb72b283a2df18a981d073aecad8 (patch)
treefb455f394de7c798080179621dafd95de671f770 /src
parentb8a188e19e7ec0ae381c18a5a4db86fb576bf95a (diff)
downloadreflectub-996426344348fb72b283a2df18a981d073aecad8.tar.bz2
github::Repo: Change `git_url` to `clone_url`
I was getting errors mirroring and updating: failed to connect to github.com: Connection timed out; class=Os (2) and remote 'origin' already exists; class=Config (7); code=Exists(-4) It turns out that the `git_url` field, which I had been using previously to mirror and clone repositories, stopped working. My guess is that it's because Reflectub is not authorised to clone GitHub "git://" URLs, so the connection timed out. I'm not sure why this stopped being allowed, though. The URL change seems to have happened around March 2022, or at least between December 2021 and April 2022. The second error was caused by a previously-created repository existing in the filesystem, but not being in the database as it hadn't been correctly mirrored. For now, I've decided not to fix that problem and am only fixing the URL issue. The GitHub API also includes a `clone_url` field, which contains an HTTPS clone URL. Using this URL to mirror fixes the timeout problem.
Diffstat (limited to 'src')
-rw-r--r--src/github.rs2
-rw-r--r--src/main.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/github.rs b/src/github.rs
index a3bb74e..7af0d93 100644
--- a/src/github.rs
+++ b/src/github.rs
@@ -43,7 +43,7 @@ pub struct Repo {
pub name: String,
pub description: Option<String>,
pub fork: bool,
- pub git_url: String,
+ pub clone_url: String,
pub default_branch: String,
pub size: u64,
pub updated_at: String,
diff --git a/src/main.rs b/src/main.rs
index 6ff441b..2360f57 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -241,7 +241,7 @@ where
P2: AsRef<Path>,
{
git::mirror(
- &repo.git_url,
+ &repo.clone_url,
&clone_path,
repo.description(),
&repo.default_branch,