]> source.dussan.org Git - gitea.git/commit
Prevent context deadline error propagation in GetCommitsInfo (#20346) (#20361)
author6543 <6543@obermui.de>
Thu, 14 Jul 2022 02:44:34 +0000 (04:44 +0200)
committerGitHub <noreply@github.com>
Thu, 14 Jul 2022 02:44:34 +0000 (03:44 +0100)
commit780b198997b316aa2f268bfea87057f9e7440a0b
tree28a444c4902ede21fc82d2019426949ceb24e530
parentf4e219f668059a86939acc9d1cdc2d172f2282bd
Prevent context deadline error propagation in GetCommitsInfo (#20346) (#20361)

Backport #20346

Although `WalkGitLog` tries to test for `context.DeadlineExceededErr`
there is a small chance that the error will propagate to the reader
before it is recognised. This will cause the error to propagate up to
`renderDirectoryFiles` and cause a http status 500.

Here we check that the error passed is a `DeadlineExceededErr` via error.Is

Fix #20329

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
modules/git/log_name_status.go