Add subcomand 'pulls create' (#144)

wordings

print pull URL

change title required mesage

inform User on push error

fix body

🚀

finish

impruve

fix help menue of pull create

refactor

Add pull-request command

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Sandro Santilli <strk@kbt.io>
Reviewed-on: https://gitea.com/gitea/tea/pulls/144
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
This commit is contained in:
6543
2020-07-16 15:00:51 +00:00
parent 66947bcf09
commit f1801f39a6
2 changed files with 120 additions and 0 deletions

View File

@ -175,3 +175,17 @@ func (r TeaRepo) TeaFindBranchByName(branchName, repoURL string) (b *git_config.
}
return b, b.Validate()
}
// TeaGetCurrentBranchName return the name of the branch witch is currently active
func (r TeaRepo) TeaGetCurrentBranchName() (string, error) {
localHead, err := r.Head()
if err != nil {
return "", err
}
if !localHead.Name().IsBranch() {
return "", fmt.Errorf("active ref is no branch")
}
return strings.TrimLeft(localHead.Name().String(), "refs/heads/"), nil
}