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 ed27c0eaec78efad42b45e079b69a6582c77fba1..74cbff32fa12c2f116fe0c6d61410d4c151dfa3b 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: $!";