Fix attempt to pull git files

This commit is contained in:
Roey Darwish Dror
2018-07-05 20:51:26 +03:00
parent d1718a22aa
commit c4ee10f50e

View File

@@ -21,9 +21,16 @@ impl Git {
pub fn get_repo_root<P: AsRef<Path>>(&self, path: P) -> Option<String> {
match path.as_ref().canonicalize() {
Ok(path) => {
Ok(mut path) => {
debug_assert!(path.exists());
if path.is_file() {
debug!("{} is a file. Checking {}", path.display(), path.parent()?.display());
path = path.parent()?.to_path_buf();
}
debug!("Checking if {} is a git repository", path.display());
if let Some(git) = &self.git {
let output = Command::new(&git)
.arg("rev-parse")