diff options
author | redmatrix <git@macgirvin.com> | 2016-06-27 04:00:10 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-06-27 04:00:10 -0700 |
commit | 85d2ad4aea106417dc3d8ce2429d13dd858c5201 (patch) | |
tree | 72e03b3fe379829a4e2f9c521366fb14e1eaa970 /Zotlabs/Storage/GitRepo.php | |
parent | d5d5d78e3aded9a3238ccb7e93b4c6fd4b873331 (diff) | |
parent | 8d298d5a068845856c9827c0d2ea3f02f1399d72 (diff) | |
download | volse-hubzilla-85d2ad4aea106417dc3d8ce2429d13dd858c5201.tar.gz volse-hubzilla-85d2ad4aea106417dc3d8ce2429d13dd858c5201.tar.bz2 volse-hubzilla-85d2ad4aea106417dc3d8ce2429d13dd858c5201.zip |
Merge branch 'dev' into perms
Diffstat (limited to 'Zotlabs/Storage/GitRepo.php')
-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), '.')) { |