equal
deleted
inserted
replaced
21 pub fn new(repo: &Repo) -> Result<Self, HgError> { |
21 pub fn new(repo: &Repo) -> Result<Self, HgError> { |
22 let cwd = current_dir()?; |
22 let cwd = current_dir()?; |
23 let repo_root = repo.working_directory_path(); |
23 let repo_root = repo.working_directory_path(); |
24 let repo_root = cwd.join(repo_root); // Make it absolute |
24 let repo_root = cwd.join(repo_root); // Make it absolute |
25 let repo_root_hgpath = |
25 let repo_root_hgpath = |
26 HgPathBuf::from(get_bytes_from_path(repo_root.to_owned())); |
26 HgPathBuf::from(get_bytes_from_path(&repo_root)); |
27 |
27 |
28 if let Ok(cwd_relative_to_repo) = cwd.strip_prefix(&repo_root) { |
28 if let Ok(cwd_relative_to_repo) = cwd.strip_prefix(&repo_root) { |
29 // The current directory is inside the repo, so we can work with |
29 // The current directory is inside the repo, so we can work with |
30 // relative paths |
30 // relative paths |
31 Ok(Self { |
31 Ok(Self { |