aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/repo_compare.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-06-16 23:47:44 +0800
committerGitHub <noreply@github.com>2022-06-16 23:47:44 +0800
commit157b4057531b99b2d3b5c086f385c830aa38354f (patch)
tree5a7f066be290cefe174b7f5ab5f48f478921a226 /modules/git/repo_compare.go
parent70ce051f1a7e266dccdd7cfd42f88a2570448770 (diff)
downloadgitea-157b4057531b99b2d3b5c086f385c830aa38354f.tar.gz
gitea-157b4057531b99b2d3b5c086f385c830aa38354f.zip
Remove legacy git code (ver < 2.0), fine tune markup tests (#19930)
* clean git support for ver < 2.0 * fine tune tests for markup (which requires git module) * remove unnecessary comments * try to fix tests * try test again * use const for GitVersionRequired instead of var * try to fix integration test * Refactor CheckAttributeReader to make a *git.Repository version * update document for commit signing with Gitea's internal gitconfig * update document for commit signing with Gitea's internal gitconfig Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/git/repo_compare.go')
-rw-r--r--modules/git/repo_compare.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/modules/git/repo_compare.go b/modules/git/repo_compare.go
index 4b0cc8536b..3c7af73000 100644
--- a/modules/git/repo_compare.go
+++ b/modules/git/repo_compare.go
@@ -255,13 +255,7 @@ func (repo *Repository) GetDiff(base, head string, w io.Writer) error {
// GetDiffBinary generates and returns patch data between given revisions, including binary diffs.
func (repo *Repository) GetDiffBinary(base, head string, w io.Writer) error {
- if CheckGitVersionAtLeast("1.7.7") == nil {
- return NewCommand(repo.Ctx, "diff", "-p", "--binary", "--histogram", base, head).Run(&RunOpts{
- Dir: repo.Path,
- Stdout: w,
- })
- }
- return NewCommand(repo.Ctx, "diff", "-p", "--binary", "--patience", base, head).Run(&RunOpts{
+ return NewCommand(repo.Ctx, "diff", "-p", "--binary", "--histogram", base, head).Run(&RunOpts{
Dir: repo.Path,
Stdout: w,
})