diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-09-23 22:29:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-09-23 22:29:12 -0700 |
commit | 683b56791b4e8a29ff9bc98c7faff69d7854d845 (patch) | |
tree | c5a42c25b0eacc16066342d1d22e2dd000372c00 /git-remote.perl | |
parent | 1b4cbb5d5880091b1f4980e7a3f5cac276352bee (diff) | |
download | git-683b56791b4e8a29ff9bc98c7faff69d7854d845.tar.gz |
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-x | git-remote.perl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/git-remote.perl b/git-remote.perl index f513a8ad99..b7c1e01d7d 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"; |