forked from qt-creator/qt-creator
VCS: Fix diff viewer for paths with spaces
Task-number: QTCREATORBUG-8330 Change-Id: I25c8f7172f38716ab625705c4969a7685d373e4e Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -1382,6 +1382,12 @@ QString VcsBaseEditorWidget::findDiffFile(const QString &f) const
|
||||
if (in.isFile())
|
||||
return in.absoluteFilePath();
|
||||
|
||||
// 4) remove trailing tab char and try again: At least git appends \t when the
|
||||
// filename contains spaces. Since the diff commend does use \t all of a sudden,
|
||||
// too, when seeing spaces in a filename, I expect the same behavior in other VCS.
|
||||
if (f.endsWith(QLatin1Char('\t')))
|
||||
return findDiffFile(f.left(f.length() - 1));
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user