mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	On open repository open common cat file batch and batch-check (#15667)
Use common git cat-file --batch and git cat-file --batch-check to
significantly reduce calls to git.
    
Signed-off-by: Andrew Thornton <art27@cantab.net>
			
			
This commit is contained in:
		| @@ -29,9 +29,10 @@ func TestBlob_Data(t *testing.T) { | ||||
| 	r, err := testBlob.DataAsync() | ||||
| 	assert.NoError(t, err) | ||||
| 	require.NotNil(t, r) | ||||
| 	defer r.Close() | ||||
|  | ||||
| 	data, err := ioutil.ReadAll(r) | ||||
| 	assert.NoError(t, r.Close()) | ||||
|  | ||||
| 	assert.NoError(t, err) | ||||
| 	assert.Equal(t, output, string(data)) | ||||
| } | ||||
| @@ -54,7 +55,7 @@ func Benchmark_Blob_Data(b *testing.B) { | ||||
| 		if err != nil { | ||||
| 			b.Fatal(err) | ||||
| 		} | ||||
| 		defer r.Close() | ||||
| 		ioutil.ReadAll(r) | ||||
| 		_ = r.Close() | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user