From 43a445963968dac7da190b56f7c89ac0ff1f6abd Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 17 Jul 2024 10:53:20 +0100 Subject: 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 --- src/git.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/git.rs') 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 @@ -#[cfg(test)] -use std::path::PathBuf; -use std::{env::current_dir, path::Path}; +use std::{ + env::current_dir, + path::{Path, PathBuf}, +}; use anyhow::{bail, Context, Result}; use git2::{DiffOptions, Oid, Revwalk}; @@ -18,7 +19,6 @@ impl Repo { git_repo: git2::Repository::discover(current_dir()?)?, }) } - #[cfg(test)] pub fn from_path(path: &PathBuf) -> Result { Ok(Self { git_repo: git2::Repository::open(path)?, -- cgit v1.2.3