From cc6032a7166f470538cea29302683f1f3f83e08b Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Fri, 24 Jul 2015 17:58:37 +0100 Subject: [PATCH] Need to pass the wait group by pointer to checkout --- commands/command_checkout.go | 4 ++-- commands/command_pull.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/command_checkout.go b/commands/command_checkout.go index 618529e8..5d192dcd 100644 --- a/commands/command_checkout.go +++ b/commands/command_checkout.go @@ -33,7 +33,7 @@ func checkoutCommand(cmd *cobra.Command, args []string) { c := make(chan *lfs.WrappedPointer) - checkoutWithChan(c, wait) + checkoutWithChan(c, &wait) for _, pointer := range pointers { c <- pointer } @@ -50,7 +50,7 @@ func init() { // If the file exists but has other content it is left alone // 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 -func checkoutWithChan(in <-chan *lfs.WrappedPointer, wait sync.WaitGroup) { +func checkoutWithChan(in <-chan *lfs.WrappedPointer, wait *sync.WaitGroup) { go func() { // Fire up the update-index command cmd := exec.Command("git", "update-index", "-q", "--refresh", "--stdin") diff --git a/commands/command_pull.go b/commands/command_pull.go index 5d731332..1c696444 100644 --- a/commands/command_pull.go +++ b/commands/command_pull.go @@ -32,7 +32,7 @@ func pullCommand(cmd *cobra.Command, args []string) { wait.Add(1) // 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 - checkoutWithChan(fetchChan, wait) + checkoutWithChan(fetchChan, &wait) // Do the downloading & report to channel which checkout watches fetchAndReportToChan(pointers, fetchChan)