Skip to content

Commit

Permalink
feat: git push pull integration #8338
Browse files Browse the repository at this point in the history
  • Loading branch information
prajapati-kaushik committed Feb 20, 2024
1 parent 3a90966 commit 5ae751b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ yarn-error.log
/.php_cs
/.php_cs.cache
###< friendsofphp/php-cs-fixer ###
.php-cs-fixer.cache
8 changes: 7 additions & 1 deletion Services/WikiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ public function publishWikiPage(Wiki $wiki, WikiPage $wikiPage, string $username
$repo->execute('config', 'user.email', $userEmail);
} else {
$repo = $this->git->open($path);
$repo->execute('config', 'committer.name', $username);
$repo->execute('config', 'committer.email', $userEmail);
}

$path .= '/'.$wiki->getName();
Expand Down Expand Up @@ -370,7 +372,11 @@ public function pull(Wiki $wiki)
$path = $this->gitDirPath;

if (!is_dir($path.'/.git')) {
return null;
$repo = $this->git->init($path, [
'--initial-branch=main',
]);
} else {
$repo = $this->git->open($path);
}

$repo = $this->git->open($path);
Expand Down

0 comments on commit 5ae751b

Please sign in to comment.