From 996426344348fb72b283a2df18a981d073aecad8 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 4 Jun 2022 05:25:48 +0200 Subject: 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. --- src/github.rs | 2 +- src/main.rs | 2 +- 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, 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, { git::mirror( - &repo.git_url, + &repo.clone_url, &clone_path, repo.description(), &repo.default_branch, -- cgit v1.2.3