diff --git a/lib/scm/gogs.class.php b/lib/scm/gogs.class.php index 7daa11739e..5d54d92f82 100644 --- a/lib/scm/gogs.class.php +++ b/lib/scm/gogs.class.php @@ -188,6 +188,9 @@ class gogsRepo */ public function createBranch($branchName = '', $ref = 'master') { + $branches = $this->branch(); + if(isset($branches[$branchName])) return array('result' => 'fail', 'message' => 'Branch is exists'); + chdir($this->root); execCmd(escapeCmd("{$this->client} stash")); $res = execCmd(escapeCmd("{$this->client} checkout -b {$branchName} origin/{$ref}"), 'array');