gitea/modules/gitrepo
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
..
archive.go Refactor git command stdio pipe (#36422) 2026-01-22 06:04:26 +00:00
blame.go Refactor git command stdio pipe (#36422) 2026-01-22 06:04:26 +00:00
blame_sha256_test.go Move blame to gitrepo (#36161) 2025-12-16 16:14:14 -08:00
blame_test.go Move blame to gitrepo (#36161) 2025-12-16 16:14:14 -08:00
branch.go Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
cat_file.go Refactor cat-file batch operations and support `--batch-command` approach (#35775) 2026-01-08 13:37:36 -08:00
clone.go Move some functions to gitrepo package to reduce RepoPath reference directly (#36126) 2025-12-12 01:15:40 +01:00
command.go Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
commit.go Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
commit_file.go Refactor git command stdio pipe (#36422) 2026-01-22 06:04:26 +00:00
commit_file_test.go Move commit related functions to gitrepo package (#35600) 2025-12-05 00:20:23 +00:00
commit_test.go Move some functions to gitrepo package to reduce RepoPath reference directly (#36126) 2025-12-12 01:15:40 +01:00
commitgraph.go
compare.go Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
compare_test.go
config.go Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
diff.go Refactor git command stdio pipe (#36422) 2026-01-22 06:04:26 +00:00
fetch.go Some refactors about GetMergeBase (#36186) 2026-01-17 11:22:09 -08:00
fsck.go
gitrepo.go Some refactor for repo path (#36251) 2025-12-29 18:49:54 +00:00
hooks.go
main_test.go Use merge tree to detect conflicts when possible (#36400) 2026-01-27 11:57:20 -08:00
merge.go Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
merge_tree.go Use merge tree to detect conflicts when possible (#36400) 2026-01-27 11:57:20 -08:00
merge_tree_test.go Use merge tree to detect conflicts when possible (#36400) 2026-01-27 11:57:20 -08:00
push.go Use gitrepo's clone and push when possible (#36093) 2025-12-10 09:41:01 -08:00
ref.go
remote.go Refactor git command stderr handling (#36402) 2026-01-18 15:10:33 -08:00
repo_lock.go Some refactors about GetMergeBase (#36186) 2026-01-17 11:22:09 -08:00
signing.go Remove undocumented support of signing key in the repository git configuration file (#36143) 2025-12-14 17:34:45 +00:00
size.go
tag.go
url.go
walk_gogit.go
walk_nogogit.go