Fix Login Detection By Repo Param (#151)

Fix login detection by Repo param

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/151
Reviewed-by: lafriks <lafriks@noreply.gitea.io>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
6543
2020-07-17 16:36:48 +00:00
parent 19ee32168e
commit 2135af0304
3 changed files with 22 additions and 12 deletions

View File

@@ -81,15 +81,10 @@ var AllDefaultFlags = append([]cli.Flag{
// initCommand returns repository and *Login based on flags
func initCommand() (*Login, string, string) {
login := initCommandLoginOnly()
login, repoPath, err := curGitRepoPath(repoValue)
if err != nil {
log.Fatal(err.Error())
var err error
repoPath := repoValue
if repoPath == "" {
login, repoPath, err = curGitRepoPath()
if err != nil {
log.Fatal(err.Error())
}
}
owner, repo := splitRepo(repoPath)