Skip to content

Commit 4ddd4bd

Browse files
tklausergitster
authored andcommitted
git-svn: trim leading and trailing whitespaces in author name
In some cases, the svn author names might contain leading or trailing whitespaces, leading to messages such as: Author: user1 not defined in authors.txt (the trailing newline leads to the line break). The user "user1" is defined in authors.txt though, e.g. user1 = User <[email protected]> Fix this by trimming the author name retreived from svn before using it in check_author. Helped-by: Eric Sunshine <[email protected]> Signed-off-by: Tobias Klauser <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5fa0f52 commit 4ddd4bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

perl/Git/SVN.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,6 +1491,10 @@ sub call_authors_prog {
14911491

14921492
sub check_author {
14931493
my ($author) = @_;
1494+
if (defined $author) {
1495+
$author =~ s/^\s+//g;
1496+
$author =~ s/\s+$//g;
1497+
}
14941498
if (!defined $author || length $author == 0) {
14951499
$author = '(no author)';
14961500
}

0 commit comments

Comments
 (0)