chiark / gitweb /
dgit: $isuite fixes: defer pushing and rpush_handle_protovsn_bothends in rpush
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 9 Jan 2017 16:03:45 +0000 (16:03 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 9 Jan 2017 16:05:21 +0000 (16:05 +0000)
We mustn't call pushing until we have parsed the arguments enough to
find $isuite.  So remove the call to pushing from
cmd_remote_push_build_host.  Now we rely on cmd_push's call to
pushing, which it does after the argument parsing.

We then need to move rpush_handle_protovsn_bothends (which implicitly
calls accesss_*) too, until we have got $isuite and called pushing().
We can move that into dopush.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index e314791f63e82c525af6941459785d25451f2fec..11f473ca8bf7c56096316094382db3f45f150a6e 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4007,6 +4007,7 @@ END
     prep_ud();
 
     access_giturl(); # check that success is vaguely likely
     prep_ud();
 
     access_giturl(); # check that success is vaguely likely
+    rpush_handle_protovsn_bothends() if $we_are_initiator;
     select_tagformat();
 
     my $clogpfn = ".git/dgit/changelog.822.tmp";
     select_tagformat();
 
     my $clogpfn = ".git/dgit/changelog.822.tmp";
@@ -4380,8 +4381,6 @@ sub cmd_remote_push_build_host {
     $we_are_responder = 1;
     $us .= " (build host)";
 
     $we_are_responder = 1;
     $us .= " (build host)";
 
-    pushing();
-
     open PI, "<&STDIN" or die $!;
     open STDIN, "/dev/null" or die $!;
     open PO, ">&STDOUT" or die $!;
     open PI, "<&STDIN" or die $!;
     open STDIN, "/dev/null" or die $!;
     open PO, ">&STDOUT" or die $!;
@@ -4400,7 +4399,6 @@ sub cmd_remote_push_build_host {
        unless defined $protovsn;
 
     responder_send_command("dgit-remote-push-ready $protovsn");
        unless defined $protovsn;
 
     responder_send_command("dgit-remote-push-ready $protovsn");
-    rpush_handle_protovsn_bothends();
     changedir $dir;
     &cmd_push;
 }
     changedir $dir;
     &cmd_push;
 }