From 432fa12c5365a131f7212fd9bb70aa7e64c7205a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Tue, 8 Sep 2026 10:19:08 +0000 Subject: [PATCH] fix: prune the store the caller asked for --- src/scripts/link.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/scripts/link.rs b/src/scripts/link.rs index dad1596..90c780f 100644 --- a/src/scripts/link.rs +++ b/src/scripts/link.rs @@ -99,7 +99,7 @@ fn restore_one(repo: &Repo, path: &Path, report: &Report) -> Result<()> { fs::remove_file(&src).with_context(|| format!("removing {}", src.display()))?; move_path(&stored, &src)?; - prune_empty(stored.parent(), &store_root()?); + prune_empty(stored.parent(), &repo.base); report.line("restored", &rel); Ok(()) @@ -425,22 +425,24 @@ fn list_others(repo: &Repo, ignored: bool, pathspecs: &[PathBuf]) -> Result) -> Result { let root = git_root()?; - let store = match store { + let base = match store { Some(store) => store.to_path_buf(), None => store_root()?, }; Ok(Self { - root: root.clone(), - store: store.join(repo_components(&root)?), + store: base.join(repo_components(&root)?), + root, + base, }) } - fn relative(&self, src: &Path) -> Result { let rel = src.strip_prefix(&self.root).map_err(|_| { anyhow!(