Commit ec27e20f7a for perl
commit ec27e20f7ac8d868b64bce212a3cb521068200e1
Author: Karl Williamson <khw@cpan.org>
Date: Fri Oct 9 09:29:04 2026 -0600
porting/symbol_visibility.t: Deal with conflict markers
This automatically handles conflict markers, so as to avoid manual
intervention. This arises when there are two active PRs that both
change the length; then one gets merged.
diff --git a/t/porting/symbol_visibility.t b/t/porting/symbol_visibility.t
index 1a9a87ec7b..015d747b49 100644
--- a/t/porting/symbol_visibility.t
+++ b/t/porting/symbol_visibility.t
@@ -48,10 +48,24 @@ my $new_length = length $string;
my $length_file = 'porting/symbol_visibility.dat';
open my $data_fh, '<', $length_file or die "Can't open $length_file: $!";
-my $stored_length = <$data_fh>;
+my $stored_length = join "", <$data_fh>;
close $data_fh or die "Couldn't close $length_file: $!";
chomp $stored_length;
+if ($stored_length eq "") {
+ fail("$length_file shouldn't be empty");
+ exit 1;
+}
+
+# If there was a conflict, remove all but the final numeric value. This makes
+# rebasing more convenient
+$stored_length =~ s/^<<<<<<< HEAD\n\d+\n=======\n//;
+$stored_length =~ s/\n>>>>>>> .*//;
+if ($stored_length !~ /\d/ || $stored_length =~ /\D/) {
+ fail("Unexpected syntax in $length_file:\n$stored_length");
+ exit 1;
+}
+
if (! is($new_length, $stored_length,
"regen/embed.pl: unresolved lists length unchanged"))
{