mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-27 15:54:36 +02:00
Fix lint
This commit is contained in:
parent
2461ad00ff
commit
4579e49532
@ -109,14 +109,14 @@ func (cr *CompareInfo) IsSameRef() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// display pull related information or not
|
// display pull related information or not
|
||||||
func (ci *CompareInfo) IsPull() bool {
|
func (cr *CompareInfo) IsPull() bool {
|
||||||
return ci.CaretTimes == 0 && !ci.DirectComparison() &&
|
return cr.CaretTimes == 0 && !cr.DirectComparison() &&
|
||||||
ci.BaseFullRef.IsBranch() && (ci.HeadRepo == nil || ci.HeadFullRef.IsBranch())
|
cr.BaseFullRef.IsBranch() && (cr.HeadRepo == nil || cr.HeadFullRef.IsBranch())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ci *CompareInfo) Close() {
|
func (cr *CompareInfo) Close() {
|
||||||
if ci.close != nil {
|
if cr.close != nil {
|
||||||
ci.close()
|
cr.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,15 +309,15 @@ func ParseComparePathParams(ctx context.Context, pathParam string, baseRepo *rep
|
|||||||
return ci, nil
|
return ci, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ci *CompareInfo) LoadRootRepoAndOwnForkRepo(ctx context.Context, baseRepo *repo_model.Repository, doer *user_model.User) (*repo_model.Repository, *repo_model.Repository, error) {
|
func (cr *CompareInfo) LoadRootRepoAndOwnForkRepo(ctx context.Context, baseRepo *repo_model.Repository, doer *user_model.User) (*repo_model.Repository, *repo_model.Repository, error) {
|
||||||
// find root repo
|
// find root repo
|
||||||
var rootRepo *repo_model.Repository
|
var rootRepo *repo_model.Repository
|
||||||
var err error
|
var err error
|
||||||
if !baseRepo.IsFork {
|
if !baseRepo.IsFork {
|
||||||
rootRepo = baseRepo
|
rootRepo = baseRepo
|
||||||
} else {
|
} else {
|
||||||
if !ci.HeadRepo.IsFork {
|
if !cr.HeadRepo.IsFork {
|
||||||
rootRepo = ci.HeadRepo
|
rootRepo = cr.HeadRepo
|
||||||
} else {
|
} else {
|
||||||
rootRepo, err = getRootRepo(ctx, baseRepo)
|
rootRepo, err = getRootRepo(ctx, baseRepo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -328,7 +328,7 @@ func (ci *CompareInfo) LoadRootRepoAndOwnForkRepo(ctx context.Context, baseRepo
|
|||||||
|
|
||||||
// find ownfork repo
|
// find ownfork repo
|
||||||
var ownForkRepo *repo_model.Repository
|
var ownForkRepo *repo_model.Repository
|
||||||
if doer != nil && ci.HeadRepo.OwnerID != doer.ID && baseRepo.OwnerID != doer.ID {
|
if doer != nil && cr.HeadRepo.OwnerID != doer.ID && baseRepo.OwnerID != doer.ID {
|
||||||
ownForkRepo, err = findHeadRepo(ctx, baseRepo, doer.ID)
|
ownForkRepo, err = findHeadRepo(ctx, baseRepo, doer.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user