|
@@ 27-38 (lines=12) @@
|
| 24 |
|
$this->name = $name; |
| 25 |
|
} |
| 26 |
|
|
| 27 |
|
public static function createBare(Client $client, Directory $directory, string $name): Repository |
| 28 |
|
{ |
| 29 |
|
$repositoryDirectory = $directory->create($directory->getPath() . '/' . $name); |
| 30 |
|
|
| 31 |
|
$result = $client->run($repositoryDirectory, new PlainArgument('init'), new LongFlag('bare')); |
| 32 |
|
|
| 33 |
|
if (!$result->isSuccess()) { |
| 34 |
|
throw new Exception($result->getErrorMessage()); |
| 35 |
|
} |
| 36 |
|
|
| 37 |
|
return new self($client, $directory, $name); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
public static function create(Client $client, Directory $directory, string $name): Repository |
| 41 |
|
{ |
|
@@ 40-51 (lines=12) @@
|
| 37 |
|
return new self($client, $directory, $name); |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
public static function create(Client $client, Directory $directory, string $name): Repository |
| 41 |
|
{ |
| 42 |
|
$repositoryDirectory = $directory->create($directory->getPath() . '/' . $name); |
| 43 |
|
|
| 44 |
|
$result = $client->run($repositoryDirectory, new PlainArgument('init')); |
| 45 |
|
|
| 46 |
|
if (!$result->isSuccess()) { |
| 47 |
|
throw new Exception($result->getErrorMessage()); |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
return new self($client, $directory, $name); |
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
public function clone(Directory $directory, string $name): Repository |
| 54 |
|
{ |