chiark / gitweb /
Minor fix to remote functionality:
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 497687ac2b7932d34a4eb5f893a0bdb647339b81..37a61111db92ea2bf3257cb6259b25e667f76348 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1504,16 +1504,6 @@ sub cmd_rpush {
        };
        i_method "i_resp", $icmd, $iargs;
     }
-
-    my $pid = $i_child_pid;
-    $i_child_pid = undef; # prevents killing some other process with same pid
-    printdebug "waiting for remote child $pid...";
-    my $got = waitpid $pid, 0;
-    die $! unless $got == $pid;
-    die "remote child failed $?" if $?;
-
-    i_cleanup();
-    exit 0;
 }
 
 sub i_resp_progress ($) {
@@ -1523,7 +1513,15 @@ sub i_resp_progress ($) {
 }
 
 sub i_resp_complete {
+    my $pid = $i_child_pid;
+    $i_child_pid = undef; # prevents killing some other process with same pid
+    printdebug "waiting for remote child $pid...\n";
+    my $got = waitpid $pid, 0;
+    die $! unless $got == $pid;
+    die "remote child failed $?" if $?;
+
     i_cleanup();
+    printdebug "all done\n";
     exit 0;
 }