mirror of
https://gitea.com/gitea/tea.git
synced 2024-09-01 04:14:18 -04:00
Fix running in repos without remote (#472)
For tea, the case of no remotes in the local repo context is equal to `errNotAGiteaRepo`. This error type is already gracefully handled, so with this change, tea doesn't reject working from a repo without remotes. fixes #455, closes #465 Co-authored-by: Norwin <git@nroo.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/472 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Norwin <noerw@noreply.gitea.io> Co-committed-by: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
parent
6663d9f19b
commit
329200b1ef
@ -157,9 +157,8 @@ func contextFromLocalRepo(repoPath, remoteValue string) (*git.TeaRepo, *config.L
|
||||
return repo, nil, "", err
|
||||
}
|
||||
|
||||
// if no remote
|
||||
if len(gitConfig.Remotes) == 0 {
|
||||
return repo, nil, "", errors.New("No remote(s) found in this Git repository")
|
||||
return repo, nil, "", errNotAGiteaRepo
|
||||
}
|
||||
|
||||
// When no preferred value is given, choose a remote to find a
|
||||
|
Loading…
Reference in New Issue
Block a user