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:
parent
038e1db4df
commit
270aab429e
26 changed files with 468 additions and 166 deletions
|
@ -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 := ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue