Skip to content

Commit f46b1a6

Browse files
committed
revert the name of divergence info
1 parent e4e7766 commit f46b1a6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

routers/web/repo/view_home.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func prepareRecentlyPushedNewBranches(ctx *context.Context) {
227227
continue
228228
}
229229
// Base is the pushed branch (for fork branch or local pushed branch perspective)
230-
if divergingInfo.BaseIsNewer || divergingInfo.CommitsBehind > 0 {
230+
if divergingInfo.BaseHasNewCommits || divergingInfo.CommitsBehind > 0 {
231231
finalBranches = append(finalBranches, branch)
232232
}
233233
}

services/repository/branch.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,9 +645,9 @@ func SetRepoDefaultBranch(ctx context.Context, repo *repo_model.Repository, gitR
645645
}
646646

647647
type BranchDivergingInfo struct {
648-
BaseIsNewer bool
649-
CommitsBehind int
650-
CommitsAhead int
648+
BaseHasNewCommits bool
649+
CommitsBehind int
650+
CommitsAhead int
651651
}
652652

653653
// getBranchDivergingInfo returns the information about the divergence of a patch branch to the base branch.
@@ -672,8 +672,8 @@ func GetBranchDivergingInfo(ctx reqctx.RequestContext, baseRepo, headRepo *repo_
672672
// so at the moment, we first check the update time, then check whether the fork branch has base's head
673673
diff, err := git.GetDivergingCommits(ctx, baseRepo.RepoPath(), baseGitBranch.CommitID, headGitBranch.CommitID)
674674
if err != nil {
675-
info.BaseIsNewer = baseGitBranch.UpdatedUnix > headGitBranch.UpdatedUnix
676-
if headRepo.IsFork && info.BaseIsNewer {
675+
info.BaseHasNewCommits = baseGitBranch.UpdatedUnix > headGitBranch.UpdatedUnix
676+
if headRepo.IsFork && info.BaseHasNewCommits {
677677
return info, nil
678678
}
679679
// if the base's update time is before the fork, check whether the base's head is in the fork
@@ -694,7 +694,7 @@ func GetBranchDivergingInfo(ctx reqctx.RequestContext, baseRepo, headRepo *repo_
694694
return nil, err
695695
}
696696
hasPreviousCommit, _ := headCommit.HasPreviousCommit(baseCommitID)
697-
info.BaseIsNewer = !hasPreviousCommit
697+
info.BaseHasNewCommits = !hasPreviousCommit
698698
return info, nil
699699
}
700700

templates/repo/code/upstream_diverging_info.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{if and .UpstreamDivergingInfo (or .UpstreamDivergingInfo.BaseIsNewer .UpstreamDivergingInfo.CommitsBehind)}}
1+
{{if and .UpstreamDivergingInfo (or .UpstreamDivergingInfo.BaseHasNewCommits .UpstreamDivergingInfo.CommitsBehind)}}
22
<div class="ui message flex-text-block">
33
<div class="tw-flex-1">
44
{{$upstreamLink := printf "%s/src/branch/%s" .Repository.BaseRepo.Link (.Repository.BaseRepo.DefaultBranch|PathEscapeSegments)}}

0 commit comments

Comments
 (0)