You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

296 lines
7.9 KiB

10 years ago
10 years ago
Compare branches, commits and tags with each other (#6991) * Supports tags when comparing commits or branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Hide headline when only comparing and don't load unused data Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Merges compare logics to allow comparing branches, commits and tags with eachother Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Display branch or tag instead of commit when used for comparing Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show pull request form after click on button Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Transfers relevant pull.go changes from master to compare.go Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes error when comparing forks against a commit or tag Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes console.log from JavaScript file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show icon next to commit reference when comparing branch or tag Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Updates css file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes import order * Renames template variable * Update routers/repo/compare.go Co-Authored-By: zeripath <art27@cantab.net> * Update from master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Allow short-shas in compare * Renames prInfo to compareInfo Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check PR permissions only if compare is pull request Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjusts comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use compareInfo instead of prInfo
5 years ago
Better logging (#6038) (#6095) * Panic don't fatal on create new logger Fixes #5854 Signed-off-by: Andrew Thornton <art27@cantab.net> * partial broken * Update the logging infrastrcture Signed-off-by: Andrew Thornton <art27@cantab.net> * Reset the skip levels for Fatal and Error Signed-off-by: Andrew Thornton <art27@cantab.net> * broken ncsa * More log.Error fixes Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove nal * set log-levels to lowercase * Make console_test test all levels * switch to lowercased levels * OK now working * Fix vetting issues * Fix lint * Fix tests * change default logging to match current gitea * Improve log testing Signed-off-by: Andrew Thornton <art27@cantab.net> * reset error skip levels to 0 * Update documentation and access logger configuration * Redirect the router log back to gitea if redirect macaron log but also allow setting the log level - i.e. TRACE * Fix broken level caching * Refactor the router log * Add Router logger * Add colorizing options * Adjust router colors * Only create logger if they will be used * update app.ini.sample * rename Attribute ColorAttribute * Change from white to green for function * Set fatal/error levels * Restore initial trace logger * Fix Trace arguments in modules/auth/auth.go * Properly handle XORMLogger * Improve admin/config page * fix fmt * Add auto-compression of old logs * Update error log levels * Remove the unnecessary skip argument from Error, Fatal and Critical * Add stacktrace support * Fix tests * Remove x/sync from vendors? * Add stderr option to console logger * Use filepath.ToSlash to protect against Windows in tests * Remove prefixed underscores from names in colors.go * Remove not implemented database logger This was removed from Gogs on 4 Mar 2016 but left in the configuration since then. * Ensure that log paths are relative to ROOT_PATH * use path.Join * rename jsonConfig to logConfig * Rename "config" to "jsonConfig" to make it clearer * Requested changes * Requested changes: XormLogger * Try to color the windows terminal If successful default to colorizing the console logs * fixup * Colorize initially too * update vendor * Colorize logs on default and remove if this is not a colorizing logger * Fix documentation * fix test * Use go-isatty to detect if on windows we are on msys or cygwin * Fix spelling mistake * Add missing vendors * More changes * Rationalise the ANSI writer protection * Adjust colors on advice from @0x5c * Make Flags a comma separated list * Move to use the windows constant for ENABLE_VIRTUAL_TERMINAL_PROCESSING * Ensure matching is done on the non-colored message - to simpify EXPRESSION
5 years ago
Adds side-by-side diff for images (#6784) * Adds side-by-side diff for images Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Explain blank imports Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use complete word for width and height labels on image compare Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update index.css from master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves ImageInfo to git commit file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Assign ImageInfo function for template and sets correct target for BeforeSourcePath Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds missing comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return error if ImageInfo failed Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Avoid template panic when ImageInfo failed for some reason Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show file size on image diff Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes unused helper function Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Reverts copyright year change Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Close file reader Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update commit.go Sets correct data key * Moves reader.Close() up a few lines * Updates index.css * Updates CSS file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Transfers adjustments for image compare to compare.go file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjusts variable name Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Apply lesshint recommendations Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Do not show old image on image compare if it is not in index of base commit Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Change file size text Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
5 years ago
Adds side-by-side diff for images (#6784) * Adds side-by-side diff for images Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Explain blank imports Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use complete word for width and height labels on image compare Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update index.css from master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Moves ImageInfo to git commit file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Assign ImageInfo function for template and sets correct target for BeforeSourcePath Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adds missing comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Return error if ImageInfo failed Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Avoid template panic when ImageInfo failed for some reason Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show file size on image diff Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes unused helper function Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Reverts copyright year change Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Close file reader Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Update commit.go Sets correct data key * Moves reader.Close() up a few lines * Updates index.css * Updates CSS file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Transfers adjustments for image compare to compare.go file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjusts variable name Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Apply lesshint recommendations Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Do not show old image on image compare if it is not in index of base commit Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Change file size text Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com>
5 years ago
9 years ago
Improve listing performance by using go-git (#6478) * Use go-git for tree reading and commit info lookup. Signed-off-by: Filip Navara <navara@emclient.com> * Use TreeEntry.IsRegular() instead of ObjectType that was removed. Signed-off-by: Filip Navara <navara@emclient.com> * Use the treePath to optimize commit info search. Signed-off-by: Filip Navara <navara@emclient.com> * Extract the latest commit at treePath along with the other commits. Signed-off-by: Filip Navara <navara@emclient.com> * Fix listing commit info for a directory that was created in one commit and never modified after. Signed-off-by: Filip Navara <navara@emclient.com> * Avoid nearly all external 'git' invocations when doing directory listing (.editorconfig code path is still hit). Signed-off-by: Filip Navara <navara@emclient.com> * Use go-git for reading blobs. Signed-off-by: Filip Navara <navara@emclient.com> * Make SHA1 type alias for plumbing.Hash in go-git. Signed-off-by: Filip Navara <navara@emclient.com> * Make Signature type alias for object.Signature in go-git. Signed-off-by: Filip Navara <navara@emclient.com> * Fix GetCommitsInfo for repository with only one commit. Signed-off-by: Filip Navara <navara@emclient.com> * Fix PGP signature verification. Signed-off-by: Filip Navara <navara@emclient.com> * Fix issues with walking commit graph across merges. Signed-off-by: Filip Navara <navara@emclient.com> * Fix typo in condition. Signed-off-by: Filip Navara <navara@emclient.com> * Speed up loading branch list by keeping the repository reference (and thus all the loaded packfile indexes). Signed-off-by: Filip Navara <navara@emclient.com> * Fix lising submodules. Signed-off-by: Filip Navara <navara@emclient.com> * Fix build Signed-off-by: Filip Navara <navara@emclient.com> * Add back commit cache because of name-rev Signed-off-by: Filip Navara <navara@emclient.com> * Fix tests Signed-off-by: Filip Navara <navara@emclient.com> * Fix code style * Fix spelling * Address PR feedback Signed-off-by: Filip Navara <navara@emclient.com> * Update vendor module list Signed-off-by: Filip Navara <navara@emclient.com> * Fix getting trees by commit id Signed-off-by: Filip Navara <navara@emclient.com> * Fix remaining unit test failures * Fix GetTreeBySHA * Avoid running `git name-rev` if not necessary Signed-off-by: Filip Navara <navara@emclient.com> * Move Branch code to git module * Clean up GPG signature verification and fix it for tagged commits * Address PR feedback (import formatting, copyright headers) * Make blob lookup by SHA working * Update tests to use public API * Allow getting content from any type of object through the blob interface * Change test to actually expect the object content that is in the GIT repository * Change one more test to actually expect the object content that is in the GIT repository * Add comments
5 years ago
Compare branches, commits and tags with each other (#6991) * Supports tags when comparing commits or branches Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Hide headline when only comparing and don't load unused data Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Merges compare logics to allow comparing branches, commits and tags with eachother Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Display branch or tag instead of commit when used for comparing Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show pull request form after click on button Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Transfers relevant pull.go changes from master to compare.go Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes error when comparing forks against a commit or tag Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Removes console.log from JavaScript file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Show icon next to commit reference when comparing branch or tag Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Updates css file Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Fixes import order * Renames template variable * Update routers/repo/compare.go Co-Authored-By: zeripath <art27@cantab.net> * Update from master Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Allow short-shas in compare * Renames prInfo to compareInfo Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Check PR permissions only if compare is pull request Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Adjusts comment Signed-off-by: Mario Lubenka <mario.lubenka@googlemail.com> * Use compareInfo instead of prInfo
5 years ago
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Copyright 2019 The Gitea Authors. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package repo
  6. import (
  7. "path"
  8. "strings"
  9. "code.gitea.io/gitea/models"
  10. "code.gitea.io/gitea/modules/base"
  11. "code.gitea.io/gitea/modules/charset"
  12. "code.gitea.io/gitea/modules/context"
  13. "code.gitea.io/gitea/modules/git"
  14. "code.gitea.io/gitea/modules/log"
  15. "code.gitea.io/gitea/modules/setting"
  16. "code.gitea.io/gitea/services/gitdiff"
  17. )
  18. const (
  19. tplCommits base.TplName = "repo/commits"
  20. tplGraph base.TplName = "repo/graph"
  21. tplCommitPage base.TplName = "repo/commit_page"
  22. )
  23. // RefCommits render commits page
  24. func RefCommits(ctx *context.Context) {
  25. switch {
  26. case len(ctx.Repo.TreePath) == 0:
  27. Commits(ctx)
  28. case ctx.Repo.TreePath == "search":
  29. SearchCommits(ctx)
  30. default:
  31. FileHistory(ctx)
  32. }
  33. }
  34. // Commits render branch's commits
  35. func Commits(ctx *context.Context) {
  36. ctx.Data["PageIsCommits"] = true
  37. if ctx.Repo.Commit == nil {
  38. ctx.NotFound("Commit not found", nil)
  39. return
  40. }
  41. ctx.Data["PageIsViewCode"] = true
  42. commitsCount, err := ctx.Repo.GetCommitsCount()
  43. if err != nil {
  44. ctx.ServerError("GetCommitsCount", err)
  45. return
  46. }
  47. page := ctx.QueryInt("page")
  48. if page <= 1 {
  49. page = 1
  50. }
  51. // Both `git log branchName` and `git log commitId` work.
  52. commits, err := ctx.Repo.Commit.CommitsByRange(page)
  53. if err != nil {
  54. ctx.ServerError("CommitsByRange", err)
  55. return
  56. }
  57. commits = models.ValidateCommitsWithEmails(commits)
  58. commits = models.ParseCommitsWithSignature(commits)
  59. commits = models.ParseCommitsWithStatus(commits, ctx.Repo.Repository)
  60. ctx.Data["Commits"] = commits
  61. ctx.Data["Username"] = ctx.Repo.Owner.Name
  62. ctx.Data["Reponame"] = ctx.Repo.Repository.Name
  63. ctx.Data["CommitCount"] = commitsCount
  64. ctx.Data["Branch"] = ctx.Repo.BranchName
  65. pager := context.NewPagination(int(commitsCount), git.CommitsRangeSize, page, 5)
  66. pager.SetDefaultParams(ctx)
  67. ctx.Data["Page"] = pager
  68. ctx.HTML(200, tplCommits)
  69. }
  70. // Graph render commit graph - show commits from all branches.
  71. func Graph(ctx *context.Context) {
  72. ctx.Data["PageIsCommits"] = true
  73. ctx.Data["PageIsViewCode"] = true
  74. commitsCount, err := ctx.Repo.GetCommitsCount()
  75. if err != nil {
  76. ctx.ServerError("GetCommitsCount", err)
  77. return
  78. }
  79. allCommitsCount, err := ctx.Repo.GitRepo.GetAllCommitsCount()
  80. if err != nil {
  81. ctx.ServerError("GetAllCommitsCount", err)
  82. return
  83. }
  84. page := ctx.QueryInt("page")
  85. graph, err := models.GetCommitGraph(ctx.Repo.GitRepo, page)
  86. if err != nil {
  87. ctx.ServerError("GetCommitGraph", err)
  88. return
  89. }
  90. ctx.Data["Graph"] = graph
  91. ctx.Data["Username"] = ctx.Repo.Owner.Name
  92. ctx.Data["Reponame"] = ctx.Repo.Repository.Name
  93. ctx.Data["CommitCount"] = commitsCount
  94. ctx.Data["Branch"] = ctx.Repo.BranchName
  95. ctx.Data["RequireGitGraph"] = true
  96. ctx.Data["Page"] = context.NewPagination(int(allCommitsCount), setting.UI.GraphMaxCommitNum, page, 5)
  97. ctx.HTML(200, tplGraph)
  98. }
  99. // SearchCommits render commits filtered by keyword
  100. func SearchCommits(ctx *context.Context) {
  101. ctx.Data["PageIsCommits"] = true
  102. ctx.Data["PageIsViewCode"] = true
  103. query := strings.Trim(ctx.Query("q"), " ")
  104. if len(query) == 0 {
  105. ctx.Redirect(ctx.Repo.RepoLink + "/commits/" + ctx.Repo.BranchNameSubURL())
  106. return
  107. }
  108. all := ctx.QueryBool("all")
  109. opts := git.NewSearchCommitsOptions(query, all)
  110. commits, err := ctx.Repo.Commit.SearchCommits(opts)
  111. if err != nil {
  112. ctx.ServerError("SearchCommits", err)
  113. return
  114. }
  115. commits = models.ValidateCommitsWithEmails(commits)
  116. commits = models.ParseCommitsWithSignature(commits)
  117. commits = models.ParseCommitsWithStatus(commits, ctx.Repo.Repository)
  118. ctx.Data["Commits"] = commits
  119. ctx.Data["Keyword"] = query
  120. if all {
  121. ctx.Data["All"] = "checked"
  122. }
  123. ctx.Data["Username"] = ctx.Repo.Owner.Name
  124. ctx.Data["Reponame"] = ctx.Repo.Repository.Name
  125. ctx.Data["CommitCount"] = commits.Len()
  126. ctx.Data["Branch"] = ctx.Repo.BranchName
  127. ctx.HTML(200, tplCommits)
  128. }
  129. // FileHistory show a file's reversions
  130. func FileHistory(ctx *context.Context) {
  131. ctx.Data["IsRepoToolbarCommits"] = true
  132. fileName := ctx.Repo.TreePath
  133. if len(fileName) == 0 {
  134. Commits(ctx)
  135. return
  136. }
  137. branchName := ctx.Repo.BranchName
  138. commitsCount, err := ctx.Repo.GitRepo.FileCommitsCount(branchName, fileName)
  139. if err != nil {
  140. ctx.ServerError("FileCommitsCount", err)
  141. return
  142. } else if commitsCount == 0 {
  143. ctx.NotFound("FileCommitsCount", nil)
  144. return
  145. }
  146. page := ctx.QueryInt("page")
  147. if page <= 1 {
  148. page = 1
  149. }
  150. commits, err := ctx.Repo.GitRepo.CommitsByFileAndRange(branchName, fileName, page)
  151. if err != nil {
  152. ctx.ServerError("CommitsByFileAndRange", err)
  153. return
  154. }
  155. commits = models.ValidateCommitsWithEmails(commits)
  156. commits = models.ParseCommitsWithSignature(commits)
  157. commits = models.ParseCommitsWithStatus(commits, ctx.Repo.Repository)
  158. ctx.Data["Commits"] = commits
  159. ctx.Data["Username"] = ctx.Repo.Owner.Name
  160. ctx.Data["Reponame"] = ctx.Repo.Repository.Name
  161. ctx.Data["FileName"] = fileName
  162. ctx.Data["CommitCount"] = commitsCount
  163. ctx.Data["Branch"] = branchName
  164. pager := context.NewPagination(int(commitsCount), git.CommitsRangeSize, page, 5)
  165. pager.SetDefaultParams(ctx)
  166. ctx.Data["Page"] = pager
  167. ctx.HTML(200, tplCommits)
  168. }
  169. // Diff show different from current commit to previous commit
  170. func Diff(ctx *context.Context) {
  171. ctx.Data["PageIsDiff"] = true
  172. ctx.Data["RequireHighlightJS"] = true
  173. userName := ctx.Repo.Owner.Name
  174. repoName := ctx.Repo.Repository.Name
  175. commitID := ctx.Params(":sha")
  176. commit, err := ctx.Repo.GitRepo.GetCommit(commitID)
  177. if err != nil {
  178. if git.IsErrNotExist(err) {
  179. ctx.NotFound("Repo.GitRepo.GetCommit", err)
  180. } else {
  181. ctx.ServerError("Repo.GitRepo.GetCommit", err)
  182. }
  183. return
  184. }
  185. if len(commitID) != 40 {
  186. commitID = commit.ID.String()
  187. }
  188. statuses, err := models.GetLatestCommitStatus(ctx.Repo.Repository, commitID, 0)
  189. if err != nil {
  190. log.Error("GetLatestCommitStatus: %v", err)
  191. }
  192. ctx.Data["CommitStatus"] = models.CalcCommitStatus(statuses)
  193. diff, err := gitdiff.GetDiffCommit(models.RepoPath(userName, repoName),
  194. commitID, setting.Git.MaxGitDiffLines,
  195. setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles)
  196. if err != nil {
  197. ctx.NotFound("GetDiffCommit", err)
  198. return
  199. }
  200. parents := make([]string, commit.ParentCount())
  201. for i := 0; i < commit.ParentCount(); i++ {
  202. sha, err := commit.ParentID(i)
  203. parents[i] = sha.String()
  204. if err != nil {
  205. ctx.NotFound("repo.Diff", err)
  206. return
  207. }
  208. }
  209. ctx.Data["CommitID"] = commitID
  210. ctx.Data["Username"] = userName
  211. ctx.Data["Reponame"] = repoName
  212. var parentCommit *git.Commit
  213. if commit.ParentCount() > 0 {
  214. parentCommit, err = ctx.Repo.GitRepo.GetCommit(parents[0])
  215. if err != nil {
  216. ctx.NotFound("GetParentCommit", err)
  217. return
  218. }
  219. }
  220. setImageCompareContext(ctx, parentCommit, commit)
  221. headTarget := path.Join(userName, repoName)
  222. setPathsCompareContext(ctx, parentCommit, commit, headTarget)
  223. ctx.Data["Title"] = commit.Summary() + " · " + base.ShortSha(commitID)
  224. ctx.Data["Commit"] = commit
  225. ctx.Data["Verification"] = models.ParseCommitWithSignature(commit)
  226. ctx.Data["Author"] = models.ValidateCommitWithEmail(commit)
  227. ctx.Data["Diff"] = diff
  228. ctx.Data["Parents"] = parents
  229. ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
  230. note := &git.Note{}
  231. err = git.GetNote(ctx.Repo.GitRepo, commitID, note)
  232. if err == nil {
  233. ctx.Data["Note"] = string(charset.ToUTF8WithFallback(note.Message))
  234. ctx.Data["NoteCommit"] = note.Commit
  235. ctx.Data["NoteAuthor"] = models.ValidateCommitWithEmail(note.Commit)
  236. }
  237. ctx.Data["BranchName"], err = commit.GetBranchName()
  238. if err != nil {
  239. ctx.ServerError("commit.GetBranchName", err)
  240. }
  241. ctx.HTML(200, tplCommitPage)
  242. }
  243. // RawDiff dumps diff results of repository in given commit ID to io.Writer
  244. func RawDiff(ctx *context.Context) {
  245. if err := gitdiff.GetRawDiff(
  246. models.RepoPath(ctx.Repo.Owner.Name, ctx.Repo.Repository.Name),
  247. ctx.Params(":sha"),
  248. gitdiff.RawDiffType(ctx.Params(":ext")),
  249. ctx.Resp,
  250. ); err != nil {
  251. ctx.ServerError("GetRawDiff", err)
  252. return
  253. }
  254. }