From 6d6fdd8bf2d4ff0c188b1dc12e0cf443e232e3a7 Mon Sep 17 00:00:00 2001 From: mrbeanc Date: Sat, 23 Dec 2023 00:37:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20restore=5Fworktree()=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli.rs | 2 +- src/commands/restore.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 4216f5d..b244a87 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -110,7 +110,7 @@ enum Command { source: Option, /// worktree - #[clap(long, short, action)] + #[clap(long, short = 'W', action)] worktree: bool, /// staged diff --git a/src/commands/restore.rs b/src/commands/restore.rs index c70e52c..e90e2cc 100644 --- a/src/commands/restore.rs +++ b/src/commands/restore.rs @@ -19,9 +19,9 @@ pub fn restore_worktree(filter: Option<&Vec>, target_blobs: &Vec<(PathB }; let paths = util::integrate_paths(&paths); // file paths - let target_blobs = target_blobs // 转为相对路径(cur_dir) 与filter统一 //TODO tree改变路径表示方式后,这里需要修改 + let target_blobs = target_blobs // 转为绝对路径 //TODO tree改变路径表示方式后,这里需要修改 .iter() - .map(|(path, hash)| (util::to_workdir_relative_path(path), hash.clone())) + .map(|(path, hash)| (util::to_workdir_absolute_path(path), hash.clone())) .collect::>(); let index = Index::new();