From b74306489cec2547fce48387ca66d8f4a9528d71 Mon Sep 17 00:00:00 2001 From: Max O'Cull Date: Thu, 2 Mar 2023 14:54:02 -0500 Subject: [PATCH] Default to histogram diff --- modules/git/git.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/git/git.go b/modules/git/git.go index 24cfea8c7fe17..df263918f18c7 100644 --- a/modules/git/git.go +++ b/modules/git/git.go @@ -242,6 +242,13 @@ func syncGitConfig() (err error) { } } + if CheckGitVersionAtLeast("1.8.2") == nil { + // The `histogram` algorithm itself was added in 1.7.7, but `diff.algorithm` was supported in Git 1.8.2. + if err := configSet("diff.algorithm", "histogram"); err != nil { + return err + } + } + if SupportProcReceive { // set support for AGit flow if err := configAddNonExist("receive.procReceiveRefs", "refs/for"); err != nil {