summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2007-09-29 23:34:19 -0700
committerJunio C Hamano <gitster@pobox.com>2007-09-29 23:34:19 -0700
commit6982ccecaf32ebf8adfcb66b4225da3b46255621 (patch)
treef14a3f0c20ac974e516607b3e350d4b835712a3d
parent2af89f12c666634e92cd79a6c1af6acc34104c34 (diff)
downloadgit-6982ccecaf32ebf8adfcb66b4225da3b46255621.tar.gz
git-remote: exit with non-zero status after detecting error in "rm".
Exit with non-zero status when "git remote rm" was told to remove a non-existing remote. Signed-off-by: Jari Aalto <jari.aalto@cante.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-remote.perl6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-remote.perl b/git-remote.perl
index 79941e40fa..9ca3e7ef37 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -322,7 +322,7 @@ sub rm_remote {
my ($name) = @_;
if (!exists $remote->{$name}) {
print STDERR "No such remote $name\n";
- return;
+ return 1;
}
$git->command('config', '--remove-section', "remote.$name");
@@ -337,13 +337,13 @@ sub rm_remote {
}
};
-
my @refs = $git->command('for-each-ref',
'--format=%(refname) %(objectname)', "refs/remotes/$name");
for (@refs) {
($ref, $object) = split;
$git->command(qw(update-ref -d), $ref, $object);
}
+ return 0;
}
sub add_usage {
@@ -461,7 +461,7 @@ elsif ($ARGV[0] eq 'rm') {
print STDERR "Usage: git remote rm <remote>\n";
exit(1);
}
- rm_remote($ARGV[1]);
+ exit(rm_remote($ARGV[1]));
}
else {
print STDERR "Usage: git remote\n";