Age | Commit message (Collapse) | Author |
|
We'll call this from `main()` when things are more ready.
|
|
This is all done now.
|
|
Allow user to not be required to specify a base cgitrc file for cloned
repositories.
|
|
This lets us define common cgitrc configuration for all mirrored repos.
|
|
Check the repository description that comes back from the GitHub API
against our cached description in the database. Only write the new
description if it changed so we can avoid writing to the file in that
case.
|
|
Forgot to add commas when I added the additional fields.
|
|
This is simpler, and means we don't have to check if the database file
exists and only initialise if it doesn't. Here, we can just run the code
and trust it will do the right thing in both cases.
|
|
Store the repository description so we can check whether the description
was updated and copy it in our mirror accordingly.
|
|
|
|
If the repository was updated, write the description into the
`description` file.
Add a `github::Repo.description()` method to get an empty string if the
description is `None`. This facilitates writing to the `description`
file.
|
|
Looks like I'm not going to be using this, since the functions in this
match arm that take `database::Repo`s should take the one based on the
`github::Repo` rather than the one fetched from the database.
|
|
This gets rid of the default description string:
Unnamed repository; edit this file 'description' to name the repository.
|
|
|
|
Separate source and fork repositories into different paths.
|
|
|
|
I wanted to move `clone_path` into `mirror()` so I could make a
different clone path for forks.
|
|
Copy the repository description from GitHub into the clone repo.
|
|
If we haven't encountered a repository yet, mirror it to the filesystem.
Change `From<github::Repo>` to `From<&github::Repo>` so we don't consume
the repo and can use it later in the repo list loop.
|
|
|
|
|
|
If the repo was updated since we last cached it, update the `updated_at`
column to the new value so we know that we fetched the latest.
|
|
I think I like this better than checking the `RowNotFound` error.
|
|
Find out if the latest copy is more recent than the cached value in our
database.
|
|
|
|
Get rid of the boxed errors to make matching on errors easier.
|
|
Will be using this to implement the main logic.
|
|
|
|
Also change `repo_insert()` to take only a single repo instead of a
slice of them.
|
|
|
|
Sqlx already returns an appropriate error if no row was found.
|
|
|
|
Set up the database with a table for repositories so we can cache when
they were last updated.
|
|
|
|
|
|
|
|
Makes more sense here rather than in its own module since it models
GitHub's repository structure.
|
|
Should work like:
$ git remote update
From what I can tell from:
https://github.com/git/git/blob/a0dda6023ed82b927fa205c474654699a5b07a82/builtin/remote.c#L1452-L1490
this translates to something like:
$ git fetch --prune --multiple default --all
|
|
Move hard-coded repository values to function arguments.
|
|
Based on the guide here:
https://libgit2.org/docs/guides/101-samples/#repositories_clone_mirror
References:
https://github.com/libgit2/libgit2sharp/issues/577
https://github.com/libgit2/libgit2.github.io/pull/31
|
|
|
|
|
|
|
|
|
|
|