Need to pass the wait group by pointer to checkout
This commit is contained in:
parent
203e483c84
commit
cc6032a716
@ -33,7 +33,7 @@ func checkoutCommand(cmd *cobra.Command, args []string) {
|
|||||||
|
|
||||||
c := make(chan *lfs.WrappedPointer)
|
c := make(chan *lfs.WrappedPointer)
|
||||||
|
|
||||||
checkoutWithChan(c, wait)
|
checkoutWithChan(c, &wait)
|
||||||
for _, pointer := range pointers {
|
for _, pointer := range pointers {
|
||||||
c <- pointer
|
c <- pointer
|
||||||
}
|
}
|
||||||
@ -50,7 +50,7 @@ func init() {
|
|||||||
// If the file exists but has other content it is left alone
|
// If the file exists but has other content it is left alone
|
||||||
// returns immediately but a goroutine listens on the in channel for objects
|
// returns immediately but a goroutine listens on the in channel for objects
|
||||||
// calls wait.Done() when the final item after the channel is closed is done
|
// calls wait.Done() when the final item after the channel is closed is done
|
||||||
func checkoutWithChan(in <-chan *lfs.WrappedPointer, wait sync.WaitGroup) {
|
func checkoutWithChan(in <-chan *lfs.WrappedPointer, wait *sync.WaitGroup) {
|
||||||
go func() {
|
go func() {
|
||||||
// Fire up the update-index command
|
// Fire up the update-index command
|
||||||
cmd := exec.Command("git", "update-index", "-q", "--refresh", "--stdin")
|
cmd := exec.Command("git", "update-index", "-q", "--refresh", "--stdin")
|
||||||
|
@ -32,7 +32,7 @@ func pullCommand(cmd *cobra.Command, args []string) {
|
|||||||
wait.Add(1)
|
wait.Add(1)
|
||||||
// Prep the checkout process for items that come out of fetch
|
// Prep the checkout process for items that come out of fetch
|
||||||
// this doesn't do anything except set up the goroutine & wait on the fetchChan
|
// this doesn't do anything except set up the goroutine & wait on the fetchChan
|
||||||
checkoutWithChan(fetchChan, wait)
|
checkoutWithChan(fetchChan, &wait)
|
||||||
// Do the downloading & report to channel which checkout watches
|
// Do the downloading & report to channel which checkout watches
|
||||||
fetchAndReportToChan(pointers, fetchChan)
|
fetchAndReportToChan(pointers, fetchChan)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user