chiark / gitweb /
dgit-repos-server: Move onwardpush and break up its @cmd construction
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Mar 2015 12:01:35 +0000 (12:01 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 22 Mar 2015 15:19:50 +0000 (15:19 +0000)
infra/dgit-repos-server

index ed27c0e..74cbff3 100755 (executable)
@@ -222,6 +222,17 @@ sub movetogarbage () {
        or die "rename repo $realdestrepo to $garbagerepo: $!";
 }
 
+sub onwardpush () {
+    my @cmd = (qw(git send-pack), $destrepo);
+    push @cmd, qw(--force) if $policy & NOFFCHECK;
+    push @cmd, "$commit:refs/dgit/$suite",
+              "$tagval:refs/tags/$tagname");
+    debugcmd @cmd;
+    $!=0;
+    my $r = system @cmd;
+    !$r or die "onward push to $destrepo failed: $r $!";
+}
+
 #----- git-receive-pack -----
 
 sub fixmissing__git_receive_pack () {
@@ -538,16 +549,6 @@ sub checks () {
     }
 }
 
-sub onwardpush () {
-    my @cmd = (qw(git send-pack), $destrepo,
-              "$commit:refs/dgit/$suite",
-              "$tagval:refs/tags/$tagname");
-    debugcmd @cmd;
-    $!=0;
-    my $r = system @cmd;
-    !$r or die "onward push failed: $r $!";
-}      
-
 sub stunthook () {
     debug "stunthook";
     chdir $workrepo or die "chdir $workrepo: $!";