aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2022-06-04 05:25:48 +0200
committerTeddy Wing2022-06-04 14:10:55 +0200
commitaf1c2811362a603f8878d75590eda3e439665786 (patch)
treefb455f394de7c798080179621dafd95de671f770
parentb8a188e19e7ec0ae381c18a5a4db86fb576bf95a (diff)
downloadreflectub-make-errors-more-traceable.tar.bz2
github::Repo: Change `git_url` to `clone_url`make-errors-more-traceable
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, was changed from an "https://" URL to a "git://" URL. Since Reflectub is not authorised to clone any GitHub "git://" URLs, the connection timed out. 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 the HTTPS clone URL. This fixes the timeout problem.
-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,