From c405f2f67a9dd035a831b8993077efc8ed38118a Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Thu, 29 Dec 2016 14:30:58 -0700 Subject: [PATCH] commands: use Await() to wait after pointers have been sent --- commands/command_pre_push.go | 2 ++ commands/command_push.go | 4 ++++ test/test-push.sh | 9 ++++----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/commands/command_pre_push.go b/commands/command_pre_push.go index 7aad50a4..69af27f5 100644 --- a/commands/command_pre_push.go +++ b/commands/command_pre_push.go @@ -84,6 +84,8 @@ func prePushCommand(cmd *cobra.Command, args []string) { } uploadPointers(ctx, pointers) } + + ctx.Await() } func scanLeft(g *lfs.GitScanner, ref string) ([]*lfs.WrappedPointer, error) { diff --git a/commands/command_push.go b/commands/command_push.go index 16e7d522..1707a01f 100644 --- a/commands/command_push.go +++ b/commands/command_push.go @@ -42,6 +42,8 @@ func uploadsBetweenRefAndRemote(ctx *uploadContext, refnames []string) { } uploadPointers(ctx, pointers) } + + ctx.Await() } func scanLeftOrAll(g *lfs.GitScanner, ref string) ([]*lfs.WrappedPointer, error) { @@ -77,6 +79,8 @@ func uploadsWithObjectIDs(ctx *uploadContext, oids []string) { pointers[idx] = &lfs.WrappedPointer{Pointer: &lfs.Pointer{Oid: oid}} } uploadPointers(ctx, pointers) + + ctx.Await() } func refsByNames(refnames []string) ([]*git.Ref, error) { diff --git a/test/test-push.sh b/test/test-push.sh index d161c915..45f8ba5e 100755 --- a/test/test-push.sh +++ b/test/test-push.sh @@ -132,7 +132,7 @@ begin_test "push --all (no ref args)" [ $(grep -c "push" < push.log) -eq 6 ] git push --all origin 2>&1 | tee push.log - [ $(grep -c "(3 of 3 files)" push.log) -eq 2 ] + [ $(grep -c "(6 of 6 files)" push.log) -eq 1 ] assert_server_object "$reponame-$suffix" "$oid1" assert_server_object "$reponame-$suffix" "$oid2" assert_server_object "$reponame-$suffix" "$oid3" @@ -162,10 +162,9 @@ begin_test "push --all (no ref args)" [ $(grep -c "push" push.log) -eq 6 ] git push --all origin 2>&1 | tee push.log - grep "(2 of 2 files, 1 skipped)" push.log - grep "(3 of 3 files)" push.log - [ $(grep -c "files)" push.log) -eq 1 ] - [ $(grep -c "skipped)" push.log) -eq 1 ] + grep "(5 of 5 files, 1 skipped)" push.log + [ $(grep -c "files" push.log) -eq 1 ] + [ $(grep -c "skipped" push.log) -eq 1 ] assert_server_object "$reponame-$suffix-2" "$oid2" assert_server_object "$reponame-$suffix-2" "$oid3" assert_server_object "$reponame-$suffix-2" "$oid4"