diff --git a/t/00-merge-conflict-markers.t b/t/00-merge-conflict-markers.t index 2cbe8cf344..86f7fa5f8c 100644 --- a/t/00-merge-conflict-markers.t +++ b/t/00-merge-conflict-markers.t @@ -38,14 +38,11 @@ find({ my $fh = IO::File->new($file, 'r'); my $marker_found = 0; - my $line = 0; - while (<$fh>) { - $line++; - if (/^<<<<<>>>>>/) { - # could check for ^=====, but that's often used in text files - $marker_found = 1; - last; - } + while (my $line = <$fh>) { + # could check for ^=====, but that's often used in text files + $marker_found++ if $line =~ m|^<<<<<<|; + $marker_found++ if $line =~ m|^>>>>>>|; + last if $marker_found; } close $fh; push @failures, $file if $marker_found;