Skip to content

Commit

Permalink
Make git-remote.perl "use strict" compliant
Browse files Browse the repository at this point in the history
I was looking at some of the perl commands, and noticed that
git-remote was the only one to lack a 'use strict' pragma at the top,
which could be a good thing for its maintainability. Hopefully, the
required changes are minimal.

Signed-off-by: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Rafael Garcia-Suarez authored and Junio C Hamano committed Feb 6, 2008
1 parent ef5b9d6 commit 7deaec9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions git-remote.perl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/perl -w

use strict;
use Git;
my $git = Git->repository();

Expand Down Expand Up @@ -296,12 +297,13 @@ sub add_remote {

sub update_remote {
my ($name) = @_;
my @remotes;

my $conf = $git->config("remotes." . $name);
if (defined($conf)) {
@remotes = split(' ', $conf);
} elsif ($name eq 'default') {
undef @remotes;
@remotes = ();
for (sort keys %$remote) {
my $do_fetch = $git->config_bool("remote." . $_ .
".skipDefaultUpdate");
Expand Down Expand Up @@ -341,7 +343,7 @@ sub rm_remote {
my @refs = $git->command('for-each-ref',
'--format=%(refname) %(objectname)', "refs/remotes/$name");
for (@refs) {
($ref, $object) = split;
my ($ref, $object) = split;
$git->command(qw(update-ref -d), $ref, $object);
}
return 0;
Expand All @@ -352,7 +354,7 @@ sub add_usage {
exit(1);
}

local $VERBOSE = 0;
my $VERBOSE = 0;
@ARGV = grep {
if ($_ eq '-v' or $_ eq '--verbose') {
$VERBOSE=1;
Expand Down Expand Up @@ -395,7 +397,7 @@ sub add_usage {
update_remote("default");
exit(1);
}
for ($i = 1; $i < @ARGV; $i++) {
for (my $i = 1; $i < @ARGV; $i++) {
update_remote($ARGV[$i]);
}
}
Expand Down

0 comments on commit 7deaec9

Please sign in to comment.