From 9edbcf89ef97ae2d6886d5a6b9e30f9ff923c96d Mon Sep 17 00:00:00 2001 From: Florian Zumkeller-Quast Date: Wed, 13 Jun 2012 16:28:34 +0200 Subject: Fixed git-svn authors map compatiblity. SVN is able to use committer/author names with whitespaces inside. In this case, the git-svn author map is the better format. The first whitespace is not a good identifier as separator but the first ' = ' sequence is. Changed the behaviour to fix this. --- src/main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 60c6bb8..681824f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -55,12 +55,18 @@ QHash loadIdentityMapFile(const QString &fileName) // Support git-svn author files, too // - svn2git native: loginname Joe User // - git-svn: loginname = Joe User - int rightspace = space; - if (line.indexOf(" = ") == space) - rightspace += 2; + int rightspace = line.indexOf(" = "); + int leftspace = space; + if (rightspace == -1) { + rightspace = space; + } else { + leftspace = rightspace; + rightspace += 2; + } QByteArray realname = line.mid(rightspace).trimmed(); - line.truncate(space); + line.truncate(leftspace); + result.insert(line, realname); }; file.close(); -- cgit v1.2.1