mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 03:52:36 +02:00
Remove SavePatch and generate patches on the fly (#9302)
* Save patches to temporary files * Remove SavePatch and generate patches on the fly * Use ioutil.TempDir * fixup! Use ioutil.TempDir * fixup! fixup! Use ioutil.TempDir * RemoveAll LocalCopyPath() in initIntergrationTest * Default to status checking on PR creation * Remove unnecessary set to StatusChecking * Protect against unable to load repo * Handle conflicts * Restore original conflict setting * In TestPullRequests update status to StatusChecking before running TestPatch
This commit is contained in:
1 parent
8f16a2c37b
commit
74179d1b5e
16 files changed
+432
-406
No files matched your search
@@ -5,6 +5,7 @@
|
||||
package git
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -21,7 +22,8 @@ func TestGetFormatPatch(t *testing.T) {
|
||||
repo, err := OpenRepository(clonedPath)
|
||||
assert.NoError(t, err)
|
||||
defer repo.Close()
|
||||
rd, err := repo.GetFormatPatch("8d92fc95^", "8d92fc95")
|
||||
rd := &bytes.Buffer{}
|
||||
err = repo.GetPatch("8d92fc95^", "8d92fc95", rd)
|
||||
assert.NoError(t, err)
|
||||
patchb, err := ioutil.ReadAll(rd)
|
||||
assert.NoError(t, err)
|
||||
|
||||
Reference in new issue
Block a user