From 18dd1db38b32a8ae5d56f7ca556c87bfe68a77c2 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 28 Jun 2016 09:45:12 +0000 Subject: git-push-all: dies if any git failed Ensures that a failure is registered by myrepos if we couldn't push to a remote. And give up, rather than have it happen again as it probably indicates a misconfiguration. --- bin/git-push-all | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'bin/git-push-all') diff --git a/bin/git-push-all b/bin/git-push-all index dec5eb0c..ec351c9c 100755 --- a/bin/git-push-all +++ b/bin/git-push-all @@ -68,16 +68,20 @@ if ( defined $pushDefault ) { # mode one: assume that there are read-only remotes print "DEBUG: pushing to pushDefault alone\n"; foreach my $remote ( @pushRemotes ) { - print "DEBUG: pushing $remote\n"; - system "git push --follow-tags $remote :" - unless ( $remote eq "dgit" ); + unless ( $remote eq "dgit" ) { + print "DEBUG: pushing $remote\n"; + system "git push --follow-tags $remote :"; + exit 1 if ( $? != 0 ); + } } } else { # mode two: assume we can write to all remotes print "DEBUG: pushing to all remotes\n"; foreach my $remote ( @remotes ) { - print "DEBUG: pushing $remote\n"; - system "git push --tags $remote :" - unless ( $remote eq "dgit" ); + unless ( $remote eq "dgit" ) { + print "DEBUG: pushing $remote\n"; + system "git push --tags $remote :"; + exit 1 if ( $? != 0 ); + } } } -- cgit v1.2.3