(c *context.Context)
| 301 | } |
| 302 | |
| 303 | func ViewPullFiles(c *context.Context) { |
| 304 | c.Data["PageIsPullList"] = true |
| 305 | c.Data["PageIsPullFiles"] = true |
| 306 | |
| 307 | issue := checkPullInfo(c) |
| 308 | if c.Written() { |
| 309 | return |
| 310 | } |
| 311 | pull := issue.PullRequest |
| 312 | |
| 313 | var ( |
| 314 | diffGitRepo *git.Repository |
| 315 | startCommitID string |
| 316 | endCommitID string |
| 317 | gitRepo *git.Repository |
| 318 | ) |
| 319 | |
| 320 | if pull.HasMerged { |
| 321 | PrepareMergedViewPullInfo(c, issue) |
| 322 | if c.Written() { |
| 323 | return |
| 324 | } |
| 325 | |
| 326 | diffGitRepo = c.Repo.GitRepo |
| 327 | startCommitID = pull.MergeBase |
| 328 | endCommitID = pull.MergedCommitID |
| 329 | gitRepo = c.Repo.GitRepo |
| 330 | } else { |
| 331 | prInfo := PrepareViewPullInfo(c, issue) |
| 332 | if c.Written() { |
| 333 | return |
| 334 | } else if prInfo == nil { |
| 335 | c.NotFound() |
| 336 | return |
| 337 | } |
| 338 | |
| 339 | headRepoPath := database.RepoPath(pull.HeadUserName, pull.HeadRepo.Name) |
| 340 | |
| 341 | headGitRepo, err := git.Open(headRepoPath) |
| 342 | if err != nil { |
| 343 | c.Error(err, "open repository") |
| 344 | return |
| 345 | } |
| 346 | |
| 347 | headCommitID, err := headGitRepo.BranchCommitID(pull.HeadBranch) |
| 348 | if err != nil { |
| 349 | c.Error(err, "get head branch commit ID") |
| 350 | return |
| 351 | } |
| 352 | |
| 353 | diffGitRepo = headGitRepo |
| 354 | startCommitID = prInfo.MergeBase |
| 355 | endCommitID = headCommitID |
| 356 | gitRepo = headGitRepo |
| 357 | } |
| 358 | |
| 359 | diff, err := gitutil.RepoDiff(diffGitRepo, |
| 360 | endCommitID, conf.Git.MaxDiffFiles, conf.Git.MaxDiffLines, conf.Git.MaxDiffLineChars, |
nothing calls this directly
no test coverage detected