Skip to content
Snippets Groups Projects

Issue #3335802: Add addDotGitFolder functionality to \Drupal\fixture_manipulator\FixtureManipulator

Merged Issue #3335802: Add addDotGitFolder functionality to \Drupal\fixture_manipulator\FixtureManipulator
All threads resolved!
All threads resolved!
Files
2
@@ -351,4 +351,23 @@ class FixtureManipulator {
@@ -351,4 +351,23 @@ class FixtureManipulator {
}
}
}
}
 
/**
 
* Creates an empty .git folder after being provided a path.
 
*/
 
public function addDotGitFolder(string $path): self {
 
if (!$this->committingChanges) {
 
$this->manipulatorArguments['addDotGitFolder'][] = func_get_args();
 
return $this;
 
}
 
$fs = new Filesystem();
 
$git_directory_path = $path . "/.git";
 
if (!is_dir($git_directory_path)) {
 
$fs->mkdir($git_directory_path);
 
}
 
else {
 
throw new \LogicException("A .git directory already exists at $path.");
 
}
 
return $this;
 
}
 
}
}
Loading