Git: Avoid superfluous execution of git status on commit

Change-Id: I1cba2902165a36bd313672c5b0e15333da71cd6e
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2014-04-23 09:16:22 +03:00
committed by Orgad Shaneh
parent 2a8350eca8
commit 1edc65cc1b
2 changed files with 9 additions and 1 deletions

View File

@@ -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();