Skip to content

Commit 2ac3e8b

Browse files
committed
Follow @wxiaoguang's suggestion
1 parent b5d605a commit 2ac3e8b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

routers/web/web.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ func registerWebRoutes(m *web.Router) {
15311531
m.Group("/commits", func() {
15321532
m.Get("", repo.SetWhitespaceBehavior, repo.GetPullDiffStats, repo.ViewPullCommits)
15331533
m.Get("/list", repo.GetPullCommits)
1534-
m.Get("/{sha:[a-f0-9]{7,40}}", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForSingleCommit)
1534+
m.Get("/{sha:[a-f0-9]{7,64}}", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForSingleCommit)
15351535
})
15361536
m.Post("/merge", context.RepoMustNotBeArchived(), web.Bind(forms.MergePullRequestForm{}), repo.MergePullRequest)
15371537
m.Post("/cancel_auto_merge", context.RepoMustNotBeArchived(), repo.CancelAutoMergePullRequest)
@@ -1540,7 +1540,7 @@ func registerWebRoutes(m *web.Router) {
15401540
m.Post("/cleanup", context.RepoMustNotBeArchived(), repo.CleanUpPullRequest)
15411541
m.Group("/files", func() {
15421542
m.Get("", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForAllCommitsOfPr)
1543-
m.Get("/{shaFrom:[a-f0-9]{7,40}}..{shaTo:[a-f0-9]{7,40}}", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForRange)
1543+
m.Get("/{shaFrom:[a-f0-9]{7,64}}..{shaTo:[a-f0-9]{7,64}}", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.SetShowOutdatedComments, repo.ViewPullFilesForRange)
15441544
m.Group("/reviews", func() {
15451545
m.Get("/new_comment", repo.RenderNewCodeCommentForm)
15461546
m.Post("/comments", web.Bind(forms.CodeCommentForm{}), repo.SetShowOutdatedComments, repo.CreateCodeComment)

web_src/js/components/DiffCommitSelector.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default defineComponent({
3232
locale: {
3333
filter_changes_by_commit: el.getAttribute('data-filter_changes_by_commit'),
3434
} as Record<string, string>,
35-
merge_base: el.getAttribute('data-merge-base'),
35+
mergeBase: el.getAttribute('data-merge-base'),
3636
commits: [] as Array<Commit>,
3737
hoverActivated: false,
3838
lastReviewCommitSha: '',
@@ -190,7 +190,7 @@ export default defineComponent({
190190
const firstSelected = this.commits.findIndex((x) => x.selected);
191191
let start: string;
192192
if (firstSelected === 0) {
193-
start = this.merge_base;
193+
start = this.mergeBase;
194194
} else {
195195
start = this.commits[firstSelected - 1].id;
196196
}
@@ -199,7 +199,7 @@ export default defineComponent({
199199
if (start === end) {
200200
// if the start and end are the same, we show this single commit
201201
window.location.assign(`${this.issueLink}/commits/${start}${this.queryParams}`);
202-
} else if (start === this.merge_base && end === this.commits.at(-1).id) {
202+
} else if (start === this.mergeBase && end === this.commits.at(-1).id) {
203203
// if the first commit is selected and the last commit is selected, we show all commits
204204
window.location.assign(`${this.issueLink}/files${this.queryParams}`);
205205
} else {

0 commit comments

Comments
 (0)