Make git-remote.perl "use strict" compliant
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>
Rafael Garcia-Suarez committed
Feb 4, 2008 at 11:09 UTC
7deaec9ac7bb42da0ee40da66f663b0d589ce7ee
1 file changed
+6
-4
git-remote.perl
+6
-4
@@ -1,5 +1,6 @@
1
#!/usr/bin/perl -w
2
3
+use strict;
4
use Git;
5
my $git = Git->repository();
6
@@ -296,12 +297,13 @@ sub add_remote {
297
298
sub update_remote {
299
my ($name) = @_;
300
+ my @remotes;
301
302
my $conf = $git->config("remotes." . $name);
303
if (defined($conf)) {
304
@remotes = split(' ', $conf);
305
} elsif ($name eq 'default') {
304
- undef @remotes;
306
+ @remotes = ();
307
for (sort keys %$remote) {
308
my $do_fetch = $git->config_bool("remote." . $_ .
309
".skipDefaultUpdate");
@@ -341,7 +343,7 @@ sub rm_remote {
343
my @refs = $git->command('for-each-ref',
344
'--format=%(refname) %(objectname)', "refs/remotes/$name");
345
for (@refs) {
344
- ($ref, $object) = split;
346
+ my ($ref, $object) = split;
347
$git->command(qw(update-ref -d), $ref, $object);
348
}
349
return 0;
@@ -352,7 +354,7 @@ sub add_usage {
354
exit(1);
355
}
356
355
-local $VERBOSE = 0;
357
+my $VERBOSE = 0;
358
@ARGV = grep {
359
if ($_ eq '-v' or $_ eq '--verbose') {
360
$VERBOSE=1;
@@ -395,7 +397,7 @@ elsif ($ARGV[0] eq 'update') {
397
update_remote("default");
398
exit(1);
399
}
398
- for ($i = 1; $i < @ARGV; $i++) {
400
+ for (my $i = 1; $i < @ARGV; $i++) {
401
update_remote($ARGV[$i]);
402
}
403
}