diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-06-12 14:38:48 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-06-12 14:38:48 -0400 |
commit | a1183bf09a93459282078038b94ef89c00297604 (patch) | |
tree | 2e14bec170e37c6615fcd5ff2892233ddffce452 /Zotlabs/Storage | |
parent | 7fc2b13fe605ad461f6b6aeacd6a187c1ef794de (diff) | |
parent | 1789c3242adcf11fe37f0ef0ec6180966853eeda (diff) | |
download | volse-hubzilla-a1183bf09a93459282078038b94ef89c00297604.tar.gz volse-hubzilla-a1183bf09a93459282078038b94ef89c00297604.tar.bz2 volse-hubzilla-a1183bf09a93459282078038b94ef89c00297604.zip |
Merge remote-tracking branch 'upstream/dev' into embedphotos
Diffstat (limited to 'Zotlabs/Storage')
-rw-r--r-- | Zotlabs/Storage/GitRepo.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Zotlabs/Storage/GitRepo.php b/Zotlabs/Storage/GitRepo.php index 2a24e03c0..306abc0ba 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 { @@ -118,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), '.')) { |