summaryrefslogtreecommitdiff
path: root/src/plugins/git
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2013-08-02 12:15:04 +0300
committerOrgad Shaneh <orgads@gmail.com>2013-08-06 04:52:58 +0200
commit208aeb79edc63b597c0a968f2c3ee7726c6d049b (patch)
treef45a6d67d7923a2c5d165e802d1d1cc37d115666 /src/plugins/git
parent1b13122cd103e3df80631fc1446889b89d995429 (diff)
downloadqt-creator-208aeb79edc63b597c0a968f2c3ee7726c6d049b.tar.gz
Introduce Utils::SynchronousProcess::normalizeNewlines
Replaces \r\n? with \n. Some console applications (e.g. git-push, git-rebase) use \r alone to move the cursor to the line's beginning. This should be replaced by \n rather than just be erased. Change-Id: I8d614d2b471e59decdbfa7f173ffa7fbdb11759b Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git')
-rw-r--r--src/plugins/git/gitclient.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 7dab68eba6..c7fe23bc01 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -744,9 +744,7 @@ Core::IEditor *locateEditor(const char *property, const QString &entry)
// Return converted command output, remove '\r' read on Windows
static inline QString commandOutputFromLocal8Bit(const QByteArray &a)
{
- QString output = QString::fromLocal8Bit(a);
- output.remove(QLatin1Char('\r'));
- return output;
+ return Utils::SynchronousProcess::normalizeNewlines(QString::fromLocal8Bit(a));
}
// Return converted command output split into lines
@@ -3398,7 +3396,7 @@ QString GitClient::readConfig(const QString &workingDirectory, const QStringList
VcsBasePlugin::SuppressCommandLogging))
return QString();
if (Utils::HostOsInfo::isWindowsHost())
- return QString::fromUtf8(outputText).remove(QLatin1Char('\r'));
+ return Utils::SynchronousProcess::normalizeNewlines(QString::fromUtf8(outputText));
return commandOutputFromLocal8Bit(outputText);
}