aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Zumkeller-Quast <branleb@gmail.com>2012-06-13 16:28:34 +0200
committerFlorian Zumkeller-Quast <branleb@gmail.com>2012-06-13 16:28:34 +0200
commit9edbcf89ef97ae2d6886d5a6b9e30f9ff923c96d (patch)
tree18ad60e3e6705b82be9d2c7fb06d355550a4a038
parent371abece8cbaf9d0c396c3ab8d4fdd1ab2718e7d (diff)
downloadsvn2git-9edbcf89ef97ae2d6886d5a6b9e30f9ff923c96d.tar
svn2git-9edbcf89ef97ae2d6886d5a6b9e30f9ff923c96d.tar.gz
svn2git-9edbcf89ef97ae2d6886d5a6b9e30f9ff923c96d.tar.bz2
svn2git-9edbcf89ef97ae2d6886d5a6b9e30f9ff923c96d.tar.xz
svn2git-9edbcf89ef97ae2d6886d5a6b9e30f9ff923c96d.zip
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.
-rw-r--r--src/main.cpp14
1 files changed, 10 insertions, 4 deletions
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<QByteArray, QByteArray> loadIdentityMapFile(const QString &fileName)
// Support git-svn author files, too
// - svn2git native: loginname Joe User <user@example.com>
// - git-svn: loginname = Joe User <user@example.com>
- 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();