upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/git.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-07-17 10:53:20 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-07-17 10:53:20 +0100
commit43a445963968dac7da190b56f7c89ac0ff1f6abd (patch)
tree3c58f17c53de3f6ccc888323d677da12402a7891 /src/git.rs
parent65d5daf6e42683ef116369b4f6a0f99d6971667b (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.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/git.rs b/src/git.rs
index bb943a9..c13b46d 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -1,6 +1,7 @@
1#[cfg(test)] 1use std::{
2use std::path::PathBuf; 2 env::current_dir,
3use std::{env::current_dir, path::Path}; 3 path::{Path, PathBuf},
4};
4 5
5use anyhow::{bail, Context, Result}; 6use anyhow::{bail, Context, Result};
6use git2::{DiffOptions, Oid, Revwalk}; 7use 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)?,