represent the current_dir as an absolute path, not a relative one. (#262)

This commit is contained in:
Mark Thom
2020-03-07 16:00:04 -07:00
parent 6ddfef6383
commit c7591045af
3 changed files with 13 additions and 6 deletions

View File

@@ -193,8 +193,11 @@ impl SubModuleUser for IndexStore {
#[inline]
fn current_dir() -> std::path::PathBuf {
let mut path_buf = std::path::PathBuf::from(file!());
path_buf.pop();
let mut path_buf = std::path::PathBuf::from(PROJECT_DIR);
// file!() always produces a path relative to PROJECT_DIR.
path_buf = path_buf.join(std::path::PathBuf::from(file!()));
path_buf.pop();
path_buf
}