fix application bug

This commit is contained in:
Jeff
2019-05-13 11:19:18 +08:00
committed by zryfish
parent 996d6fe4c5
commit 5462f51e65
717 changed files with 87703 additions and 53426 deletions

View File

@@ -1020,7 +1020,12 @@ func pushHashes(
if err != nil {
return nil, err
}
done := make(chan error)
// Set buffer size to 1 so the error message can be written when
// ReceivePack fails. Otherwise the goroutine will be blocked writing
// to the channel.
done := make(chan error, 1)
go func() {
e := packfile.NewEncoder(wr, s, useRefDeltas)
if _, err := e.Encode(hs, config.Pack.Window); err != nil {
@@ -1033,6 +1038,8 @@ func pushHashes(
rs, err := sess.ReceivePack(ctx, req)
if err != nil {
// close the pipe to unlock encode write
_ = rd.Close()
return nil, err
}