* [bug#50305,0.3h] add tips for gogs branch is exists.

This commit is contained in:
caoyanyi
2024-05-29 09:50:06 +08:00
parent 740b39c839
commit ce1b8216c8
+3
View File
@@ -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');