]> source.dussan.org Git - gitea.git/commit
Fix slow patch checking with commits that add or remove many files (#31548) (#31560)
authorGiteabot <teabot@gitea.io>
Fri, 5 Jul 2024 09:24:01 +0000 (17:24 +0800)
committerGitHub <noreply@github.com>
Fri, 5 Jul 2024 09:24:01 +0000 (11:24 +0200)
commit6486c8b7b3f6d6a8b2ea0465a06526ae9206680f
tree44a19f5bc530981dd2340e3dbf9715395d9dc15b
parent35c5192b2572041f14a4d33cbd0128da887b360e
Fix slow patch checking with commits that add or remove many files (#31548) (#31560)

Backport #31548 by @brechtvl

Running git update-index for every individual file is slow, so add and
remove everything with a single git command.

When such a big commit lands in the default branch, it could cause PR
creation and patch checking for all open PRs to be slow, or time out
entirely. For example, a commit that removes 1383 files was measured to
take more than 60 seconds and timed out. With this change checking took
about a second.

This is related to #27967, though this will not help with commits that
change many lines in few files.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
modules/git/repo_index.go
services/pull/patch.go