summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-06-22 18:04:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-22 18:21:07 (GMT)
commit94b2ee1aeeb2dbec8383118db74d5c5c0a95476f (patch)
treefb77cd9fd725cef67f1f81ceb11c069ff9a5ee25 /git-svn.perl
parentff508e227c881acf6016c88ddde8158664ee18e3 (diff)
downloadgit-94b2ee1aeeb2dbec8383118db74d5c5c0a95476f.zip
git-94b2ee1aeeb2dbec8383118db74d5c5c0a95476f.tar.gz
git-94b2ee1aeeb2dbec8383118db74d5c5c0a95476f.tar.bz2
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 <sandals@crustytoothpaste.net> Acked-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 7c735ce..00276c0 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2008,10 +2008,10 @@ sub cmt_sha2rev_batch {
print $out $sha, "\n";
while (my $line = <$in>) {
- if ($first && $line =~ /^[[:xdigit:]]{40}\smissing$/) {
+ if ($first && $line =~ /^$::oid\smissing$/) {
last;
} elsif ($first &&
- $line =~ /^[[:xdigit:]]{40}\scommit\s(\d+)$/) {
+ $line =~ /^$::oid\scommit\s(\d+)$/) {
$first = 0;
$size = $1;
next;