mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08: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:
		@@ -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