From 049147a9d78b981482297c3daf48c67f31754259 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sat, 21 May 2016 19:02:23 -0400 Subject: Successful new wiki git repo and item table record --- Zotlabs/Storage/GitRepo.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Zotlabs/Storage') diff --git a/Zotlabs/Storage/GitRepo.php b/Zotlabs/Storage/GitRepo.php index 2a24e03c0..f4a129bb3 100644 --- a/Zotlabs/Storage/GitRepo.php +++ b/Zotlabs/Storage/GitRepo.php @@ -75,6 +75,15 @@ class GitRepo { } } } + + public function initRepo() { + if(!$this->path) return false; + try { + return $this->git->init($this->path); + } catch (\PHPGit\Exception\GitException $ex) { + return false; + } + } public function pull() { try { -- cgit v1.2.3 From 63a97ff6fc313372d9cb439a621f12fdecc2fac1 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 29 May 2016 10:18:26 -0400 Subject: Git commit made for the page edits when the page is saved. --- Zotlabs/Storage/GitRepo.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Zotlabs/Storage') diff --git a/Zotlabs/Storage/GitRepo.php b/Zotlabs/Storage/GitRepo.php index f4a129bb3..306abc0ba 100644 --- a/Zotlabs/Storage/GitRepo.php +++ b/Zotlabs/Storage/GitRepo.php @@ -127,6 +127,15 @@ class GitRepo { $repo['logs'] = $git->log(array('limit' => 50)); return $repo; } + + // Commit changes to the repo. Default is to stage all changes and commit everything. + public function commit($msg, $options = array()) { + try { + return $this->git->commit($msg, $options); + } catch (\PHPGit\Exception\GitException $ex) { + return false; + } + } public static function isValidGitRepoURL($url) { if (validate_url($url) && strrpos(parse_url($url, PHP_URL_PATH), '.')) { -- cgit v1.2.3