Skip to content
Snippets Groups Projects
Commit c9147b36 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Git: Change mapping of repository to directory name

Change the mapping of repository name to checkout directory name.
This should now work better with windows.
parent 6b85c2d5
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,8 @@ QString CloneWizardPage::directoryFromRepository(const QString &urlIn) const
* 'user@host:qt/qt.git', 'http://host/qt/qt.git' 'local repo'
* ------> 'qt' . */
QString url = urlIn.trimmed();
QString url = urlIn.trimmed().replace(QChar('\\'), QChar('/'));
const QChar slash = QLatin1Char('/');
// remove host
const int protocolDelimiterPos = url.indexOf(d->protocolDelimiter); // "://"
......@@ -115,8 +116,9 @@ QString CloneWizardPage::directoryFromRepository(const QString &urlIn) const
}
// fix invalid characters
const QChar dash = QLatin1Char('-');
url.replace(slash, dash);
url.replace(QLatin1Char('.'), dash);
url.replace(QRegExp(QLatin1String("[^0-9a-zA-Z_-]")), dash);
// trim leading dashes (they are annoying and get created when using local pathes)
url.replace(QRegExp(QLatin1String("^-+")), QString());
return url;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment