Skip to contentSkip to conversation

git-svn: cleanup sprintf usage for uppercasing hex

PATCH In review Eric Wong 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore

Eric Wong

author
#0 lore raw

PATCH 1/1 git-svn: cleanup sprintf usage for uppercasing hex

We do not need to call uc() separately for sprintf("%x") as sprintf("%X") is available.

---
 perl/Git/SVN.pm        | 4 ++--
 perl/Git/SVN/Editor.pm | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
perl/Git/SVN.pm +2 -2
index 59215fa..490e330 100644
@@ -490,7 +490,7 @@ sub refname {
 	#
 	# Additionally, % must be escaped because it is used for escaping
 	# and we want our escaped refname to be reversible
-	$refname =~ s{([ \%~\^:\?\*\[\t])}{uc sprintf('%%%02x',ord($1))}eg;
+	$refname =~ s{([ \%~\^:\?\*\[\t])}{sprintf('%%%02X',ord($1))}eg;
 
 	# no slash-separated component can begin with a dot .
 	# /.* becomes /%2E*
@@ -2377,7 +2377,7 @@ sub map_path {
 
 sub uri_encode {
 	my ($f) = @_;
-	$f =~ s#([^a-zA-Z0-9\*!\:_\./\-])#uc sprintf("%%%02x",ord($1))#eg;
+	$f =~ s#([^a-zA-Z0-9\*!\:_\./\-])#sprintf("%%%02X",ord($1))#eg;
 	$f
 }
 
perl/Git/SVN/Editor.pm +1 -1
index 3db1521..fa0d3c6 100644
@@ -146,7 +146,7 @@ sub url_path {
 	my ($self, $path) = @_;
 	if ($self->{url} =~ m#^https?://#) {
 		# characters are taken from subversion/libsvn_subr/path.c
-		$path =~ s#([^~a-zA-Z0-9_./!$&'()*+,-])#uc sprintf("%%%02x",ord($1))#eg;
+		$path =~ s#([^~a-zA-Z0-9_./!$&'()*+,-])#sprintf("%%%02X",ord($1))#eg;
 	}
 	$self->{url} . '/' . $self->repo_path($path);
 }
Signature · 1 line
Eric Wong
author
#1 lore raw

[PULL] git-svn updates for master

The following changes since commit ec3ae6ec46ed48383ae40643990f169b65a563cc:

Merge git://ozlabs.org/~paulus/gitk (2013-01-23 08:35:03 -0800)

are available in the git repository at:

git://bogomips.org/git-svn master

for you to fetch changes up to 812ed405ac961093b7eb916246d5f288630edfb2:

git-svn: cleanup sprintf usage for uppercasing hex (2013-01-24 01:30:04 +0000)

----------------------------------------------------------------
Barry Wardell (1):
git-svn: Simplify calculation of GIT_DIR

Eric Wong (1):
git-svn: cleanup sprintf usage for uppercasing hex

 git-svn.perl             | 38 +++++++++++++++-----------------------
 perl/Git/SVN.pm          |  4 ++--
 perl/Git/SVN/Editor.pm   |  2 +-
 t/t9100-git-svn-basic.sh |  8 ++++++++
 4 files changed, 26 insertions(+), 26 deletions(-)
Signature · 1 line
Eric Wong
author
#2 lore raw

[PULL (updated)] git-svn updates for master

I've squashed the change I mentioned in
http://mid.gmane.org/[email protected]
to Barry's commit, and added Jonathan's Reviewed-by to my cleanup commit.

The following changes since commit ec3ae6ec46ed48383ae40643990f169b65a563cc:

Merge git://ozlabs.org/~paulus/gitk (2013-01-23 08:35:03 -0800)

are available in the git repository at:

git://bogomips.org/git-svn for-junio

for you to fetch changes up to bc93ceb7c5ec959ad275f575a3c49ff491337a8b:

git-svn: Simplify calculation of GIT_DIR (2013-01-24 10:21:23 +0000)

(My old master is unchanged.)

----------------------------------------------------------------
Barry Wardell (1):
git-svn: Simplify calculation of GIT_DIR

Eric Wong (1):
git-svn: cleanup sprintf usage for uppercasing hex

 git-svn.perl             | 37 ++++++++++++++-----------------------
 perl/Git/SVN.pm          |  4 ++--
 perl/Git/SVN/Editor.pm   |  2 +-
 t/t9100-git-svn-basic.sh |  8 ++++++++
 4 files changed, 25 insertions(+), 26 deletions(-)
Signature · 1 line
Eric Wong