fix:去除current_head()返回值中的\n

\n会导致文件写入失败
This commit is contained in:
mrbeanc
2023-12-21 14:25:40 +08:00
parent 2dc58245e7
commit a459a0922e
7 changed files with 24 additions and 21 deletions

View File

@@ -165,7 +165,8 @@ pub fn get_relative_path(path: &Path, dir: &Path) -> PathBuf {
relative_path.to_path_buf()
}
pub fn to_root_relative_path(path: &Path) -> PathBuf {
/// 获取相较于工作区(Working Dir)的相对路径
pub fn to_root_relative_path(path: &Path) -> PathBuf { //todo: rename
get_relative_path(path, &get_working_dir().unwrap())
}