From 4d75232a72cb5f87b6dafa042898b7249123b88a Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 28 Jan 2024 10:43:14 +0100 Subject: [PATCH] fix: assure Git index updates to refs are actually written. The remote git repository may alter its references in such a way that local fast-forwards aren't possible anymore. This happens regularly as the history will be squashed on the remote. Now we forcefully store the updated references, which resolves the issue that calling `update()` didn't seem to do anything despite being busy (i.e. downloading a possibly huge pack, and resolving it). --- src/git/impl_.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git/impl_.rs b/src/git/impl_.rs index 475188a3..9282666b 100644 --- a/src/git/impl_.rs +++ b/src/git/impl_.rs @@ -239,7 +239,7 @@ impl GitIndex { .unwrap_or_else(|| self.repo.remote_at(self.url.as_str()).expect("own URL is always valid")); fetch_remote( &mut remote, - &["HEAD:refs/remotes/origin/HEAD", "master:refs/remotes/origin/master"], + &["+HEAD:refs/remotes/origin/HEAD", "+master:refs/remotes/origin/master"], )?; let head_commit = Self::find_repo_head(&self.repo, &self.path)?;