From b91cf7fe0ba5472d197f65ecc307c5e7961b78b1 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Wed, 4 Sep 2024 08:54:02 +0200 Subject: i do not know what i did anymore --- src/update/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/update') diff --git a/src/update/mod.rs b/src/update/mod.rs index 7b51136..e3cd36a 100644 --- a/src/update/mod.rs +++ b/src/update/mod.rs @@ -45,8 +45,13 @@ impl Repo { let _fetched = self.fetch()?; let (remote, head) = self.default_remote_head()?; - self.update_default_branch_ref(remote.clone(), head)?; - self.checkout(remote, head, &mut progress)?; + debug!("default remote and head: {:?} {:?}", remote, head); + // TODO do not update if there are unpushed commits + self.update_default_branch_ref(&remote, head)?; + debug!("updated default branch reference"); + // TODO check out only if the default branch is currently checked out + self.checkout(&remote, head, &mut progress)?; + debug!("finished checkout"); // let merged = repo.branches(Some(BranchType::Local))? // .filter_map(|x| x.ok()) -- cgit v1.2.3