aboutsummaryrefslogtreecommitdiff
path: root/git-remote.perl
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-02-04 11:09:00 +0100
committerJunio C Hamano <gitster@pobox.com>2008-02-06 13:50:21 -0800
commit7deaec9ac7bb42da0ee40da66f663b0d589ce7ee (patch)
tree5ff48a86981b4d3a475dc8502af9bd468ed81932 /git-remote.perl
parentef5b9d6e2286630bf8afb5bdf1c6e3356f3d50c7 (diff)
downloadgit-7deaec9ac7bb42da0ee40da66f663b0d589ce7ee.tar.gz
git-7deaec9ac7bb42da0ee40da66f663b0d589ce7ee.tar.xz
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>
Diffstat (limited to 'git-remote.perl')
-rwxr-xr-xgit-remote.perl10
1 files changed, 6 insertions, 4 deletions
diff --git a/git-remote.perl b/git-remote.perl
index d13e4c1fe..5cd69513c 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -1,5 +1,6 @@
#!/usr/bin/perl -w
+use strict;
use Git;
my $git = Git->repository();
@@ -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");
@@ -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;
@@ -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;
@@ -395,7 +397,7 @@ elsif ($ARGV[0] eq 'update') {
update_remote("default");
exit(1);
}
- for ($i = 1; $i < @ARGV; $i++) {
+ for (my $i = 1; $i < @ARGV; $i++) {
update_remote($ARGV[$i]);
}
}