Files
gitea/modules/util
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
..
2024-06-11 18:47:45 +00:00
2025-05-22 12:59:42 +00:00
2025-05-22 12:59:42 +00:00
2023-07-04 18:36:08 +00:00
2025-10-20 11:43:08 -07:00
2023-05-08 19:49:59 +08:00
2025-07-30 07:08:59 +00:00
2025-07-30 07:08:59 +00:00
2023-09-16 16:03:02 +00:00
2025-04-05 11:56:48 +08:00