mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09: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:
		| @@ -43,11 +43,18 @@ func GetNote(repo *Repository, commitID string, note *Note) error { | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	defer dataRc.Close() | ||||
| 	closed := false | ||||
| 	defer func() { | ||||
| 		if !closed { | ||||
| 			_ = dataRc.Close() | ||||
| 		} | ||||
| 	}() | ||||
| 	d, err := ioutil.ReadAll(dataRc) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	_ = dataRc.Close() | ||||
| 	closed = true | ||||
| 	note.Message = d | ||||
|  | ||||
| 	treePath := "" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user