From 84d380608128ccc7dd96030d708478532e636913 Mon Sep 17 00:00:00 2001 From: Colin Rofls Date: Fri, 21 Feb 2025 15:37:40 -0500 Subject: [PATCH] Do normal git fetch after --unshallow Because --unshallow doesn't do anything if the repo isn't shallow (I assumed it would do a normal fetch, in this case) --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index bcea367..01f7437 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -505,6 +505,12 @@ fn checkout_rev(repo_dir: &Path, rev: &str) -> Result { .args(["fetch", "--unshallow"]) .output(); + // but if they're _not_ shallow, we need normal fetch :/ + let _ = std::process::Command::new("git") + .current_dir(repo_dir) + .args(["fetch"]) + .output(); + let result = std::process::Command::new("git") .current_dir(repo_dir) .arg("checkout")