diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2014-08-03 11:49:51 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2014-08-04 09:49:39 +0200 |
commit | 42bbae26a3e179e5a75684a8ca52f0c30f078a8e (patch) | |
tree | 7915ceadd8c4cb7a12c70b681153f22ccac89386 /src/plugins/git/branchdialog.cpp | |
parent | 117436a65af2958a9b513c668491b139cfad3e6c (diff) | |
download | qt-creator-42bbae26a3e179e5a75684a8ca52f0c30f078a8e.tar.gz |
Git: Do not suggest tag name for local branch
This causes unnecessary name ambiguity.
Change-Id: Id27060edb19b4902f2a93da042eb8389754b8e04
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins/git/branchdialog.cpp')
-rw-r--r-- | src/plugins/git/branchdialog.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp index 2531867dcb..d3eceed608 100644 --- a/src/plugins/git/branchdialog.cpp +++ b/src/plugins/git/branchdialog.cpp @@ -152,12 +152,16 @@ void BranchDialog::add() QStringList localNames = m_model->localBranchNames(); - QString suggestedNameBase = trackedBranch.mid(trackedBranch.lastIndexOf(QLatin1Char('/')) + 1); - QString suggestedName = suggestedNameBase; - int i = 2; - while (localNames.contains(suggestedName)) { - suggestedName = suggestedNameBase + QString::number(i); - ++i; + QString suggestedName; + if (!isTag) { + QString suggestedNameBase; + suggestedNameBase = trackedBranch.mid(trackedBranch.lastIndexOf(QLatin1Char('/')) + 1); + suggestedName = suggestedNameBase; + int i = 2; + while (localNames.contains(suggestedName)) { + suggestedName = suggestedNameBase + QString::number(i); + ++i; + } } BranchAddDialog branchAddDialog(localNames, true, this); |