Update models/git/branch.go

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
yp05327 2023-11-20 08:35:29 +09:00 committed by GitHub
parent b3d6bed21d
commit 4bd9cdba22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,7 +142,7 @@ func (b *Branch) LoadPusher(ctx context.Context) (err error) {
} }
func (b *Branch) LoadRepo(ctx context.Context) (err error) { func (b *Branch) LoadRepo(ctx context.Context) (err error) {
if b.Repo != nil && b.RepoID == 0 { if b.Repo != nil || b.RepoID == 0 {
return nil return nil
} }
b.Repo, err = repo_model.GetRepositoryByID(ctx, b.RepoID) b.Repo, err = repo_model.GetRepositoryByID(ctx, b.RepoID)