summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2af89f1)
raw | patch | inline | side by side (parent: 2af89f1)
author | Jari Aalto <jari.aalto@cante.net> | |
Sun, 30 Sep 2007 06:34:19 +0000 (23:34 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 30 Sep 2007 06:34:19 +0000 (23:34 -0700) |
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>
remove a non-existing remote.
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-remote.perl | patch | blob | history |
diff --git a/git-remote.perl b/git-remote.perl
index 79941e40fa66069169d41881ff5c6a433dc34ab5..9ca3e7ef3792260e98d68e1a95a2ccfceeac5c55 100755 (executable)
--- a/git-remote.perl
+++ b/git-remote.perl
my ($name) = @_;
if (!exists $remote->{$name}) {
print STDERR "No such remote $name\n";
- return;
+ return 1;
}
$git->command('config', '--remove-section', "remote.$name");
}
};
-
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 {
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";