aboutsummaryrefslogtreecommitdiff
path: root/git-remote.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-23 22:29:12 -0700
committerJunio C Hamano <gitster@pobox.com>2007-09-23 22:29:12 -0700
commit683b56791b4e8a29ff9bc98c7faff69d7854d845 (patch)
treec5a42c25b0eacc16066342d1d22e2dd000372c00 /git-remote.perl
parent1b4cbb5d5880091b1f4980e7a3f5cac276352bee (diff)
downloadgit-683b56791b4e8a29ff9bc98c7faff69d7854d845.tar.gz
git-683b56791b4e8a29ff9bc98c7faff69d7854d845.tar.xz
git-remote rm: add tests and minor fix-ups
This fixes "git remote rm" which always exited with a failure, corrects indentation, and adds tests. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-remote.perl')
-rwxr-xr-xgit-remote.perl10
1 files changed, 4 insertions, 6 deletions
diff --git a/git-remote.perl b/git-remote.perl
index f513a8ad9..b7c1e01d7 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -317,7 +317,7 @@ sub update_remote {
}
sub rm_remote {
- my ($name) = @_;
+ my ($name) = @_;
if (!exists $remote->{$name}) {
print STDERR "No such remote $name\n";
return;
@@ -336,7 +336,7 @@ sub rm_remote {
};
- my @refs = $git->command('for-each-ref',
+ my @refs = $git->command('for-each-ref',
'--format=%(refname) %(objectname)', "refs/remotes/$name");
for (@refs) {
($ref, $object) = split;
@@ -453,11 +453,9 @@ elsif ($ARGV[0] eq 'add') {
elsif ($ARGV[0] eq 'rm') {
if (@ARGV <= 1) {
print STDERR "Usage: git remote rm <remote>\n";
+ exit(1);
}
- else {
- rm_remote($ARGV[1]);
- }
- exit(1);
+ rm_remote($ARGV[1]);
}
else {
print STDERR "Usage: git remote\n";