Create a unit tested parsePatchHeader() subroutine for svn-apply and svn-unapply. In addition to providing more test coverage, this will result in more code sharing between svn-apply and svn-unapply. This affects the code in the main while(<>) loop of both scripts: while (<>) { s/([\n\r]+)$//mg; my $eol = $1; if (!defined($indexPath) && m#^diff --git a/#) { $filter = \&gitdiff2svndiff; } $_ = &$filter($_) if $filter; if (/^Index: (.+)/) { ... } if ($indexPath) { # Fix paths on diff, ---, and +++ lines to match preceding Index: line. s/^--- \S+/--- $indexPath/; if (/^--- .+\(from (\S+):\d+\)$/) { $copiedFromPath = $1; } if (s/^\+\+\+ \S+/+++ $indexPath/) { $indexPath = ""; }
*** This bug has been marked as a duplicate of bug 33447 ***