Skip to content

Commit 77b38a0

Browse files
committed
add FIXME for abused GitDiff
1 parent 44c2766 commit 77b38a0

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

routers/api/v1/repo/pull.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,8 @@ func GetPullRequestFiles(ctx *context.APIContext) {
15911591
maxLines := setting.Git.MaxGitDiffLines
15921592

15931593
// FIXME: If there are too many files in the repo, may cause some unpredictable issues.
1594+
// FIXME: when using "skip-to", the NumFiles (totalNumberOfFiles, totalNumberOfPages) will be wrong
1595+
// FIXME: it doesn't need to call "GetDiff" to do various parsing and hightlighting
15941596
diff, err := gitdiff.GetDiff(ctx, baseGitRepo,
15951597
&gitdiff.DiffOptions{
15961598
BeforeCommitID: startCommitID,

services/convert/git_commit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ func ToCommit(ctx context.Context, repo *repo_model.Repository, gitRepo *git.Rep
210210

211211
// Get diff stats for commit
212212
if opts.Stat {
213+
// FIXME: it should not call GitDiff, here it only needs "--shortdiff"
213214
diff, err := gitdiff.GetDiff(ctx, gitRepo, &gitdiff.DiffOptions{
214215
AfterCommitID: commit.ID.String(),
215216
})

0 commit comments

Comments
 (0)