wait for command to finish before closing the channel

This commit is contained in:
risk danger olson 2016-02-17 11:57:45 -07:00
parent fc9658ecf4
commit 7f63e585ee

@ -293,8 +293,9 @@ func revListShas(refLeft, refRight string, opt *ScanRefsOptions) (chan string, e
} }
revs <- sha1 revs <- sha1
} }
cmd.Wait()
close(revs) close(revs)
cmd.Cmd.Wait()
}() }()
return revs, nil return revs, nil
@ -344,8 +345,9 @@ func revListIndex(cache bool, indexMap *indexFileMap) (chan string, error) {
revs <- sha1 revs <- sha1
} }
} }
cmd.Wait()
close(revs) close(revs)
cmd.Cmd.Wait()
}() }()
return revs, nil return revs, nil
@ -382,8 +384,9 @@ func catFileBatchCheck(revs chan string) (chan string, error) {
} }
} }
} }
cmd.Wait()
close(smallRevs) close(smallRevs)
cmd.Cmd.Wait()
}() }()
go func() { go func() {
@ -440,8 +443,9 @@ func catFileBatch(revs chan string) (chan *WrappedPointer, error) {
break break
} }
} }
cmd.Wait()
close(pointers) close(pointers)
cmd.Cmd.Wait()
}() }()
go func() { go func() {