checkout: tone down the "forked status" diagnostic messages
[gitweb.git] / git-remote.perl
index 79941e40fa66069169d41881ff5c6a433dc34ab5..d13e4c1fea93f0c345f6638bfd8a3715c73fa693 100755 (executable)
@@ -244,7 +244,8 @@ sub show_remote {
        print "* remote $name\n";
        print "  URL: $info->{'URL'}\n";
        for my $branchname (sort keys %$branch) {
-               next if ($branch->{$branchname}{'REMOTE'} ne $name);
+               next unless (defined $branch->{$branchname}{'REMOTE'} &&
+                            $branch->{$branchname}{'REMOTE'} eq $name);
                my @merged = map {
                        s|^refs/heads/||;
                        $_;
@@ -322,7 +323,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 +338,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 +462,7 @@ 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";