summaryrefslogtreecommitdiff
path: root/bin/git-push-all
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2016-06-28 09:45:12 +0000
committerSean Whitton <spwhitton@spwhitton.name>2016-06-28 09:45:12 +0000
commit18dd1db38b32a8ae5d56f7ca556c87bfe68a77c2 (patch)
tree1d489a816cdaa6bd9bd2d9b5ca439e9c1c274238 /bin/git-push-all
parent3a8a6071094f57263d7f04be7350f72c103344b5 (diff)
downloaddotfiles-18dd1db38b32a8ae5d56f7ca556c87bfe68a77c2.tar.gz
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.
Diffstat (limited to 'bin/git-push-all')
-rwxr-xr-xbin/git-push-all16
1 files changed, 10 insertions, 6 deletions
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 );
+ }
}
}