Skip to content

Commit 9edbcf8

Browse files
author
Florian Zumkeller-Quast
committed
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.
1 parent 371abec commit 9edbcf8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/main.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,18 @@ QHash<QByteArray, QByteArray> loadIdentityMapFile(const QString &fileName)
5555
// Support git-svn author files, too
5656
// - svn2git native: loginname Joe User <user@example.com>
5757
// - git-svn: loginname = Joe User <user@example.com>
58-
int rightspace = space;
59-
if (line.indexOf(" = ") == space)
60-
rightspace += 2;
58+
int rightspace = line.indexOf(" = ");
59+
int leftspace = space;
60+
if (rightspace == -1) {
61+
rightspace = space;
62+
} else {
63+
leftspace = rightspace;
64+
rightspace += 2;
65+
}
6166

6267
QByteArray realname = line.mid(rightspace).trimmed();
63-
line.truncate(space);
68+
line.truncate(leftspace);
69+
6470
result.insert(line, realname);
6571
};
6672
file.close();

0 commit comments

Comments
 (0)