summaryrefslogtreecommitdiff
path: root/src/plugins/git/gitsubmiteditor.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2014-04-23 09:16:22 +0300
committerOrgad Shaneh <orgads@gmail.com>2014-04-25 14:15:30 +0200
commit1edc65cc1b3e30e3a20920413ba5b8b8d0e2d195 (patch)
treead65581170c4de49854d1913a529ac11c6040a2a /src/plugins/git/gitsubmiteditor.cpp
parent2a8350eca840232acd8e6f100b37876b0b2cabd1 (diff)
downloadqt-creator-1edc65cc1b3e30e3a20920413ba5b8b8d0e2d195.tar.gz
Git: Avoid superfluous execution of git status on commit
Change-Id: I1cba2902165a36bd313672c5b0e15333da71cd6e Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Diffstat (limited to 'src/plugins/git/gitsubmiteditor.cpp')
-rw-r--r--src/plugins/git/gitsubmiteditor.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp
index 7857171768..fb967d00a8 100644
--- a/src/plugins/git/gitsubmiteditor.cpp
+++ b/src/plugins/git/gitsubmiteditor.cpp
@@ -90,7 +90,8 @@ GitSubmitEditor::GitSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *p
m_model(0),
m_commitEncoding(0),
m_commitType(SimpleCommit),
- m_forceClose(false)
+ m_forceClose(false),
+ m_firstUpdate(true)
{
connect(this, SIGNAL(diffSelectedFiles(QList<int>)), this, SLOT(slotDiffSelected(QList<int>)));
connect(submitEditorWidget(), SIGNAL(show(QString)), this, SLOT(showCommit(QString)));
@@ -173,6 +174,12 @@ void GitSubmitEditor::showCommit(const QString &commit)
void GitSubmitEditor::updateFileModel()
{
+ // Commit data is set when the editor is initialized, and updateFileModel immediately follows,
+ // when the editor is activated. Avoid another call to git status
+ if (m_firstUpdate) {
+ m_firstUpdate = false;
+ return;
+ }
if (m_workingDirectory.isEmpty())
return;
GitClient *client = GitPlugin::instance()->gitClient();