chiark / gitweb /
wip changes for remote push - implement i_resp_*
[dgit.git] / dgit
diff --git a/dgit b/dgit
index b551eacd1e9c7a6fa73d49a612b72e1e088efc13..eb6f01de3deecef20da7707daf375e0f3d1015b8 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1406,7 +1406,34 @@ sub cmd_rpush {
     };
     i_cleanup();
     die $@;
+}
+
+sub i_resp_progress ($) {
+    my ($rhs) = @_;
+    my $msg = protocol_read_bytes \*RO, $rhs;
+    progress $msg;
+}
+
+sub i_resp_complete {
+    i_cleanup();
+    exit 0;
+}
+
+sub i_resp_file ($) {
+    my ($keyword) = @_;
+    my $localname = i_method "i_localname_", $keyword;
+    my $localpath = "$i_tmp/$localname";
+    stat $localpath and badproto \*RO, "file $keyword ($localpath) twice";
+    protocol_receive_file \*RO, $localpath;
+}
+
+sub i_resp_want ($) {
+    my ($keyword) = @_;
+    my @localpaths = i_method "i_want_", $keyword;
+    foreach my $localpath (@localpaths) {
+       protocol_send_file \*RI, $localpath;
     }
+    print RI "end-files\n" or die $!;
 }
 
 #---------- building etc. ----------