diff options
Diffstat (limited to 'vendor/code.gitea.io/git/repo_branch.go')
-rw-r--r-- | vendor/code.gitea.io/git/repo_branch.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/code.gitea.io/git/repo_branch.go b/vendor/code.gitea.io/git/repo_branch.go index f2e9f43cdb..8366b68332 100644 --- a/vendor/code.gitea.io/git/repo_branch.go +++ b/vendor/code.gitea.io/git/repo_branch.go @@ -102,6 +102,16 @@ func (repo *Repository) DeleteBranch(name string, opts DeleteBranchOptions) erro return err } +// CreateBranch create a new branch +func (repo *Repository) CreateBranch(branch, newBranch string) error { + cmd := NewCommand("branch") + cmd.AddArguments(branch, newBranch) + + _, err := cmd.RunInDir(repo.Path) + + return err +} + // AddRemote adds a new remote to repository. func (repo *Repository) AddRemote(name, url string, fetch bool) error { cmd := NewCommand("remote", "add") |