forked from qt-creator/qt-creator
Git: Factor out pattern for invalid branch names
Re-use it in the follow-up commit for remote names also. Change-Id: Ib88792a1abdc2fa8ac23c99aa7d4861728e36eec Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
André Hartmann
parent
93299cb802
commit
57144e28da
@@ -173,6 +173,26 @@ QString GitPlugin::msgRepositoryLabel(const QString &repository)
|
||||
tr("Repository: %1").arg(QDir::toNativeSeparators(repository));
|
||||
}
|
||||
|
||||
// Returns a regular expression pattern with characters not allowed
|
||||
// in branch and remote names.
|
||||
QString GitPlugin::invalidBranchAndRemoteNamePattern()
|
||||
{
|
||||
return QLatin1String(
|
||||
"\\s" // no whitespace
|
||||
"|~" // no "~"
|
||||
"|\\^" // no "^"
|
||||
"|\\[" // no "["
|
||||
"|\\.\\." // no ".."
|
||||
"|/\\." // no slashdot
|
||||
"|:" // no ":"
|
||||
"|@\\{" // no "@{" sequence
|
||||
"|\\\\" // no backslash
|
||||
"|//" // no double slash
|
||||
"|^[/-]" // no leading slash or dash
|
||||
"|\"" // no quotes
|
||||
);
|
||||
}
|
||||
|
||||
const VcsBaseSubmitEditorParameters submitParameters = {
|
||||
Git::Constants::SUBMIT_MIMETYPE,
|
||||
Git::Constants::GITSUBMITEDITOR_ID,
|
||||
|
Reference in New Issue
Block a user