aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Storage
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-06-10 12:22:01 +0200
committerMario Vavti <mario@mariovavti.com>2016-06-10 12:22:01 +0200
commit86985b454f75ac7f87e0dfe94fd754d7cbb0bf09 (patch)
tree42094d12360158d96bf8149d1b7a4c25e5445430 /Zotlabs/Storage
parent9d5d3a946817c1b1a9dc18dead85bc989e820564 (diff)
parentc55a7b5f362e62696ef7d44cc972cb46c2802646 (diff)
downloadvolse-hubzilla-86985b454f75ac7f87e0dfe94fd754d7cbb0bf09.tar.gz
volse-hubzilla-86985b454f75ac7f87e0dfe94fd754d7cbb0bf09.tar.bz2
volse-hubzilla-86985b454f75ac7f87e0dfe94fd754d7cbb0bf09.zip
Merge branch 'dev' into sabre32
Diffstat (limited to 'Zotlabs/Storage')
-rw-r--r--Zotlabs/Storage/GitRepo.php18
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), '.')) {