git-svn: cleanup sprintf usage for uppercasing hex
We do not need to call uc() separately for sprintf("%x") as sprintf("%X") is available. Signed-off-by: Eric Wong <normalperson@yhbt.net> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Eric Wong committed
Jan 24, 2013 at 00:23 UTC
1b67bef25606471817d9b0a61a923568de0daac8
2 files changed
+3
-3
perl/Git/SVN.pm
+2
-2
@@ -490,7 +490,7 @@ sub refname {
490
#
491
# Additionally, % must be escaped because it is used for escaping
492
# and we want our escaped refname to be reversible
493
- $refname =~ s{([ \%~\^:\?\*\[\t])}{uc sprintf('%%%02x',ord($1))}eg;
493
+ $refname =~ s{([ \%~\^:\?\*\[\t])}{sprintf('%%%02X',ord($1))}eg;
494
495
# no slash-separated component can begin with a dot .
496
# /.* becomes /%2E*
@@ -2377,7 +2377,7 @@ sub map_path {
2377
2378
sub uri_encode {
2379
my ($f) = @_;
2380
- $f =~ s#([^a-zA-Z0-9\*!\:_\./\-])#uc sprintf("%%%02x",ord($1))#eg;
2380
+ $f =~ s#([^a-zA-Z0-9\*!\:_\./\-])#sprintf("%%%02X",ord($1))#eg;
2381
$f
2382
}
2383
perl/Git/SVN/Editor.pm
+1
-1
@@ -146,7 +146,7 @@ sub url_path {
146
my ($self, $path) = @_;
147
if ($self->{url} =~ m#^https?://#) {
148
# characters are taken from subversion/libsvn_subr/path.c
149
- $path =~ s#([^~a-zA-Z0-9_./!$&'()*+,-])#uc sprintf("%%%02x",ord($1))#eg;
149
+ $path =~ s#([^~a-zA-Z0-9_./!$&'()*+,-])#sprintf("%%%02X",ord($1))#eg;
150
}
151
$self->{url} . '/' . $self->repo_path($path);
152
}