Refactor getpatch/getdiff functions and remove unnecessary fallback (#32817)

Extract from #32786 

`git diff a..b` is equal to `git diff a b` which is different from `git
diff a...b`. For pull request, we should always 

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Lunny Xiao 2024-12-23 22:29:34 -08:00 committed by GitHub
parent 6d5aa9218e
commit b8b690feb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 67 deletions

View file

@ -28,7 +28,7 @@ func TestGetFormatPatch(t *testing.T) {
defer repo.Close()
rd := &bytes.Buffer{}
err = repo.GetPatch("8d92fc95^", "8d92fc95", rd)
err = repo.GetPatch("8d92fc95^...8d92fc95", rd)
if err != nil {
assert.NoError(t, err)
return