gitea/services
Lunny Xiao 1463426a27
Use merge tree to detect conflicts when possible (#36400)
In Git 2.38, the `merge-tree` command introduced the `--write-tree`
option, which works directly on bare repositories. In Git 2.40, a new parameter `--merge-base` introduced so we require Git 2.40 to use the merge tree feature.

This option produces the merged tree object ID, allowing us to perform
diffs between commits without creating a temporary repository. By
avoiding the overhead of setting up and tearing down temporary repos,
this approach delivers a notable performance improvement.

It also fixes a possible situation that conflict files might be empty
but it's a conflict status according to
https://git-scm.com/docs/git-merge-tree#_mistakes_to_avoid

Replace #35542

---------

Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-27 11:57:20 -08:00
..
actions Bugfix: Potential incorrect runID in run status update (#36437) 2026-01-23 11:11:56 +00:00
agit Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
asymkey Some refactors about GetMergeBase (#36186) 2026-01-17 11:22:09 -08:00
attachment fix attachment file size limit in server backend (#35519) 2025-10-21 15:07:11 +00:00
auth Add an option to automatically verify SSH keys from LDAP (#35927) 2025-12-27 12:33:08 +00:00
automerge Remove unnecessary function parameter (#35765) 2025-10-31 21:56:08 -07:00
automergequeue Fix various trivial problems (#35714) 2025-10-21 13:19:29 +08:00
context fix: Improve image captcha contrast for dark mode (#36265) 2026-01-24 05:41:51 +00:00
contexttest Fix diff view style handling (#36324) 2026-01-09 04:37:16 +00:00
convert fix: typos in comments (#36394) 2026-01-17 17:03:25 +00:00
cron Refactor git command context & pipeline (#36406) 2026-01-21 01:35:14 +00:00
doctor Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
externalaccount Refactor OpenIDConnect to support SSH/FullName sync (#34978) 2025-07-10 18:35:59 +00:00
feed Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
forms Move assign project when creating pull request to the same database transaction (#36244) 2026-01-04 16:45:36 +00:00
git Some refactors about GetMergeBase (#36186) 2026-01-17 11:22:09 -08:00
gitdiff Normalize guessed languages for code highlighting (#36450) 2026-01-25 14:02:16 +00:00
indexer Update issue indexer after merging a PR (#30715) 2024-05-08 14:45:15 +00:00
issue Some refactors about GetMergeBase (#36186) 2026-01-17 11:22:09 -08:00
lfs Add chunked transfer encoding support for LFS uploads (#36380) 2026-01-16 07:15:18 +08:00
mailer Refactor template render (#36438) 2026-01-24 05:11:49 +00:00
markup Refactor template render (#36438) 2026-01-24 05:11:49 +00:00
migrations Refactor GetRepoRawDiffForFile to avoid unnecessary pipe or goroutine (#36434) 2026-01-23 02:10:11 +00:00
mirror Refactor git command stdio pipe (#36422) 2026-01-22 06:04:26 +00:00
notify Don't send trigger for a pending review's comment create/update/delete (#34928) 2025-07-03 10:35:45 +08:00
oauth2_provider Make OAuth2 issuer configurable (#35915) 2025-11-10 23:45:01 +08:00
org Add more check for stopwatch read or list (#36340) 2026-01-13 13:13:39 +00:00
packages feat(debian): use explicit, stronger defaults for newly generated repo signing keys (#36236) 2026-01-01 02:36:14 +00:00
projects Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
pull Use merge tree to detect conflicts when possible (#36400) 2026-01-27 11:57:20 -08:00
release Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
repository Use merge tree to detect conflicts when possible (#36400) 2026-01-27 11:57:20 -08:00
secrets Fix various bugs (#35684) 2025-10-19 00:37:50 +08:00
task Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
uinotification Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
user Release attachments must belong to the intended repo (#36347) 2026-01-14 11:37:53 -08:00
versioned_migration Remove wrong "git.DefaultContext" (#35364) 2025-08-27 16:31:21 +00:00
webhook Bump golangci-lint to 2.7.2, enable modernize stringsbuilder (#36180) 2025-12-17 20:50:53 +00:00
webtheme Support rendering OpenAPI spec (#36449) 2026-01-26 10:34:38 +08:00
wiki Refactor git command stdio pipe (#36422) 2026-01-22 06:04:26 +00:00