diff options
author | zeripath <art27@cantab.net> | 2021-11-20 13:50:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-20 13:50:00 +0000 |
commit | 931d0cf854afc06a4d3d3dc3277d2f383efd3423 (patch) | |
tree | 66c2c3609e456a8d020af55ef801563f1105065f /modules | |
parent | 0d69e64e03de735e7116813643a37a64d8418eb4 (diff) | |
download | gitea-931d0cf854afc06a4d3d3dc3277d2f383efd3423.tar.gz gitea-931d0cf854afc06a4d3d3dc3277d2f383efd3423.zip |
Enable show more files in diff for git <2.31 (#17733)
Unfortunately due to a misread on my behalf I missed that git diff only learned
--skip-to in version 2.31.0. Thus this functionality was not working on older versions
of git.
This PR adds a handler that simply allows for us to skip reading the diffs until
we find the correct file to skip to.
Fix #17731
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/repofiles/temp_repo.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/repofiles/temp_repo.go b/modules/repofiles/temp_repo.go index 820f5f2542..700ce92ebf 100644 --- a/modules/repofiles/temp_repo.go +++ b/modules/repofiles/temp_repo.go @@ -302,7 +302,7 @@ func (t *TemporaryUploadRepository) DiffIndex() (*gitdiff.Diff, error) { if err := git.NewCommand("diff-index", "--src-prefix=\\a/", "--dst-prefix=\\b/", "--cached", "-p", "HEAD"). RunInDirTimeoutEnvFullPipelineFunc(nil, 30*time.Second, t.basePath, stdoutWriter, stderr, nil, func(ctx context.Context, cancel context.CancelFunc) error { _ = stdoutWriter.Close() - diff, finalErr = gitdiff.ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, stdoutReader) + diff, finalErr = gitdiff.ParsePatch(setting.Git.MaxGitDiffLines, setting.Git.MaxGitDiffLineCharacters, setting.Git.MaxGitDiffFiles, stdoutReader, "") if finalErr != nil { log.Error("ParsePatch: %v", finalErr) cancel() |