Fix attempt to pull git files
This commit is contained in:
@@ -21,9 +21,16 @@ impl Git {
|
|||||||
|
|
||||||
pub fn get_repo_root<P: AsRef<Path>>(&self, path: P) -> Option<String> {
|
pub fn get_repo_root<P: AsRef<Path>>(&self, path: P) -> Option<String> {
|
||||||
match path.as_ref().canonicalize() {
|
match path.as_ref().canonicalize() {
|
||||||
Ok(path) => {
|
Ok(mut path) => {
|
||||||
debug_assert!(path.exists());
|
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 {
|
if let Some(git) = &self.git {
|
||||||
let output = Command::new(&git)
|
let output = Command::new(&git)
|
||||||
.arg("rev-parse")
|
.arg("rev-parse")
|
||||||
|
|||||||
Reference in New Issue
Block a user