mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 02:08:36 +00:00
Add buttons to allow loading of incomplete diffs (#16829)
This PR adds two buttons to the stats and the end of the diffs list to load the (some of) the remaining incomplete diff sections. Contains #16775 Signed-off-by: Andrew Thornton <art27@cantab.net> ## Screenshots ### Show more button at the end of the diff  ### Show more button at the end of the diff stats box 
This commit is contained in:
@@ -318,7 +318,7 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *models.Issue) *git.C
|
||||
ctx.Data["HasMerged"] = true
|
||||
|
||||
compareInfo, err := ctx.Repo.GitRepo.GetCompareInfo(ctx.Repo.Repository.RepoPath(),
|
||||
pull.MergeBase, pull.GetGitRefName(), true)
|
||||
pull.MergeBase, pull.GetGitRefName(), true, false)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "fatal: Not a valid object name") || strings.Contains(err.Error(), "unknown revision or path not in the working tree") {
|
||||
ctx.Data["IsPullRequestBroken"] = true
|
||||
@@ -401,7 +401,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare
|
||||
}
|
||||
|
||||
compareInfo, err := baseGitRepo.GetCompareInfo(pull.BaseRepo.RepoPath(),
|
||||
pull.MergeBase, pull.GetGitRefName(), true)
|
||||
pull.MergeBase, pull.GetGitRefName(), true, false)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "fatal: Not a valid object name") {
|
||||
ctx.Data["IsPullRequestBroken"] = true
|
||||
@@ -517,7 +517,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare
|
||||
}
|
||||
|
||||
compareInfo, err := baseGitRepo.GetCompareInfo(pull.BaseRepo.RepoPath(),
|
||||
git.BranchPrefix+pull.BaseBranch, pull.GetGitRefName(), true)
|
||||
git.BranchPrefix+pull.BaseBranch, pull.GetGitRefName(), true, false)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "fatal: Not a valid object name") {
|
||||
ctx.Data["IsPullRequestBroken"] = true
|
||||
@@ -633,7 +633,7 @@ func ViewPullFiles(ctx *context.Context) {
|
||||
ctx.Data["AfterCommitID"] = endCommitID
|
||||
|
||||
diff, err := gitdiff.GetDiffRangeWithWhitespaceBehavior(gitRepo,
|
||||
startCommitID, endCommitID, setting.Git.MaxGitDiffLines,
|
||||
startCommitID, endCommitID, ctx.FormString("skip-to"), setting.Git.MaxGitDiffLines,
|
||||
setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles,
|
||||
gitdiff.GetWhitespaceFlag(ctx.Data["WhitespaceBehavior"].(string)), false)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user