aboutsummaryrefslogtreecommitdiff
path: root/src/update
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2024-09-04 08:54:02 +0200
committerMax Audron <audron@cocaine.farm>2024-09-04 08:54:02 +0200
commitb91cf7fe0ba5472d197f65ecc307c5e7961b78b1 (patch)
treec337ced6a2cc37e15d08b2d2c4a5c1819a2da50b /src/update
parentrefactor tests (diff)
i do not know what i did anymore
Diffstat (limited to 'src/update')
-rw-r--r--src/update/mod.rs9
1 files changed, 7 insertions, 2 deletions
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())