Use of uninitialized value $u in substitution (s///) at /usr/share/perl5/Git/SVN.pm line 101

When I try to migrate SVN repository to GIT repository , I was getting the below error.

Use of uninitialized value $u in substitution (s///) at /usr/share/perl5/Git/SVN.pm line 101

Open the file /usr/share/perl5/Git/SVN.pm and go to line 101.

$u =~ s!^\Q$url\E(/|$)!! or die 
        "$refname: '$url' not found in '$u'\n"; 

to this: 

if(!$u) { 
        $u = $pathname; 
}else { 
        $u =~ s!^\Q$url\E(/|$)!! or die 
        "$refname: '$url' not found in '$u'\n"; 
}