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();