From 94b2ee1aeeb2dbec8383118db74d5c5c0a95476f Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 22 Jun 2020 18:04:14 +0000 Subject: perl: make SVN code hash independent There are several places throughout git-svn that use various hard-coded constants. For matching object IDs, use the $oid variable. Compute the record size we use for our revision storage based on the object ID. When parsing the revision map format, use a wildcard in the pack format since we know that the data we're parsing is always exactly the record size. This lets us continue to use a constant for the pack format. Finally, update several comments to reflect the fact that an object ID may be of one of multiple sizes. Signed-off-by: brian m. carlson Acked-by: Eric Wong Signed-off-by: Junio C Hamano --- perl/Git/SVN/Ra.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'perl/Git/SVN/Ra.pm') diff --git a/perl/Git/SVN/Ra.pm b/perl/Git/SVN/Ra.pm index 56ad9870bc..2cfe055a9a 100644 --- a/perl/Git/SVN/Ra.pm +++ b/perl/Git/SVN/Ra.pm @@ -486,11 +486,11 @@ sub gs_fetch_loop_common { $reload_ra->() if $ra_invalid; } # pre-fill the .rev_db since it'll eventually get filled in - # with '0' x40 if something new gets committed + # with '0' x $oid_length if something new gets committed foreach my $gs (@$gsv) { next if $gs->rev_map_max >= $max; next if defined $gs->rev_map_get($max); - $gs->rev_map_set($max, 0 x40); + $gs->rev_map_set($max, 0 x $::oid_length); } foreach my $g (@$globs) { my $k = "svn-remote.$g->{remote}.$g->{t}-maxRev"; -- cgit v1.2.3