Allow browsing public snips

Fixed big with branch name not existing if nothing committed
This commit is contained in:
Tim
2023-04-06 20:30:11 +02:00
parent ce456adf10
commit 004044022d
7 changed files with 49 additions and 4 deletions

View File

@ -22,6 +22,9 @@ class SnipServiceFactory
$repoPath = sprintf('%s/%s', $this->snipBasePath, $snip->getId());
if (!is_dir($repoPath)) {
$repo = $git->init($repoPath);
touch(sprintf('%s/.gitignore', $repoPath));
$repo->addFile('.gitignore');
$repo->commit('Initial commit');
} else {
$repo = $git->open($repoPath);
}