add interactive mode for tea pr create #279

Merged
6543 merged 11 commits from noerw/tea:issue-234-pr-create-interactive into master 2020-12-08 21:41:51 +00:00
Showing only changes of commit e9ac204886 - Show all commits

View File

@ -82,6 +82,11 @@ func CreatePull(login *config.Login, repoOwner, repoName, base, head, title, des
}
}
// head & base may not be the same
if head == base {
return fmt.Errorf("Can't create PR from %s to %s\n", head, base)
}
// default is head branch name
if len(title) == 0 {
title = head
@ -94,8 +99,7 @@ func CreatePull(login *config.Login, repoOwner, repoName, base, head, title, des
}
// title is required
if len(title) == 0 {
fmt.Printf("Title is required")
return nil
return fmt.Errorf("Title is required")
}
pr, _, err := client.CreatePullRequest(repoOwner, repoName, gitea.CreatePullRequestOption{