Git: Implement "Fixup previous commit"

Change-Id: Ia2584ff975ed0db614dc878a70ce4adbd5c3ba67
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-04-30 23:26:47 +03:00
committed by Orgad Shaneh
parent 5d325f6b1a
commit 8695fe6d7c
11 changed files with 117 additions and 27 deletions

View File

@@ -103,14 +103,17 @@ const GitSubmitEditorWidget *GitSubmitEditor::submitEditorWidget() const
void GitSubmitEditor::setCommitData(const CommitData &d)
{
m_commitEncoding = d.commitEncoding;
m_workingDirectory = d.panelInfo.repository;
m_commitType = d.commitType;
m_amendSHA1 = d.amendSHA1;
GitSubmitEditorWidget *w = submitEditorWidget();
w->initialize(m_commitType, m_workingDirectory);
w->setPanelData(d.panelData);
w->setPanelInfo(d.panelInfo);
w->setHasUnmerged(false);
m_commitEncoding = d.commitEncoding;
m_workingDirectory = d.panelInfo.repository;
m_commitType = d.commitType;
setEmptyFileListEnabled(m_commitType == AmendCommit); // Allow for just correcting the message
m_model = new GitSubmitFileModel(this);
@@ -178,6 +181,12 @@ GitSubmitEditorPanelData GitSubmitEditor::panelData() const
return submitEditorWidget()->panelData();
}
QString GitSubmitEditor::amendSHA1() const
{
QString commit = submitEditorWidget()->amendSHA1();
return commit.isEmpty() ? m_amendSHA1 : commit;
}
QByteArray GitSubmitEditor::fileContents() const
{
const QString &text = submitEditorWidget()->descriptionText();