From 6455d741577ed7cff3bef7e54dcbe8537cdd09c1 Mon Sep 17 00:00:00 2001 From: nabijaczleweli Date: Sat, 24 Mar 2018 07:32:51 +0100 Subject: [PATCH] Update the cloned repository head after fetching to reflect latest changes Closes #78 --- src/ops/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ops/mod.rs b/src/ops/mod.rs index fdf5255d43..1b6acb1fc9 100644 --- a/src/ops/mod.rs +++ b/src/ops/mod.rs @@ -355,6 +355,7 @@ impl GitRepoPackage { let mut r = git2::Repository::open(clone_dir); if let Ok(ref mut r) = r.as_mut() { r.find_remote("origin").and_then(|mut rm| rm.fetch(&[self.branch.as_ref().map(String::as_str).unwrap_or("master")], None, None)).unwrap(); + r.set_head("FETCH_HEAD").unwrap(); } r } else {