diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-17 10:53:20 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-07-17 10:53:20 +0100 |
| commit | 43a445963968dac7da190b56f7c89ac0ff1f6abd (patch) | |
| tree | 3c58f17c53de3f6ccc888323d677da12402a7891 /src/git.rs | |
| parent | 65d5daf6e42683ef116369b4f6a0f99d6971667b (diff) | |
feat(login): use fetch to get user profile
fetch automatically gets updates to logged in user profile / relays
fetching without specifying repo pointers will just fetch user
profiles so that can be used during login, if user profile isn't
in cache
login now uses fetch
Diffstat (limited to 'src/git.rs')
| -rw-r--r-- | src/git.rs | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,6 +1,7 @@ | |||
| 1 | #[cfg(test)] | 1 | use std::{ |
| 2 | use std::path::PathBuf; | 2 | env::current_dir, |
| 3 | use std::{env::current_dir, path::Path}; | 3 | path::{Path, PathBuf}, |
| 4 | }; | ||
| 4 | 5 | ||
| 5 | use anyhow::{bail, Context, Result}; | 6 | use anyhow::{bail, Context, Result}; |
| 6 | use git2::{DiffOptions, Oid, Revwalk}; | 7 | use git2::{DiffOptions, Oid, Revwalk}; |
| @@ -18,7 +19,6 @@ impl Repo { | |||
| 18 | git_repo: git2::Repository::discover(current_dir()?)?, | 19 | git_repo: git2::Repository::discover(current_dir()?)?, |
| 19 | }) | 20 | }) |
| 20 | } | 21 | } |
| 21 | #[cfg(test)] | ||
| 22 | pub fn from_path(path: &PathBuf) -> Result<Self> { | 22 | pub fn from_path(path: &PathBuf) -> Result<Self> { |
| 23 | Ok(Self { | 23 | Ok(Self { |
| 24 | git_repo: git2::Repository::open(path)?, | 24 | git_repo: git2::Repository::open(path)?, |