mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-02-08 12:53:42 +08:00
fix: restore_worktree()路径问题
This commit is contained in:
@@ -110,7 +110,7 @@ enum Command {
|
||||
source: Option<String>,
|
||||
|
||||
/// worktree
|
||||
#[clap(long, short, action)]
|
||||
#[clap(long, short = 'W', action)]
|
||||
worktree: bool,
|
||||
|
||||
/// staged
|
||||
|
||||
@@ -19,9 +19,9 @@ pub fn restore_worktree(filter: Option<&Vec<PathBuf>>, 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::<Vec<(PathBuf, Hash)>>();
|
||||
|
||||
let index = Index::new();
|
||||
|
||||
Reference in New Issue
Block a user