Commit d63c68f3 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Fixes: Refactor git settings code, add some more menu options

parent 8b018225
......@@ -18,7 +18,8 @@ HEADERS += gitplugin.h \
annotationhighlighter.h \
gitsubmiteditorwidget.h \
gitsubmiteditor.h \
gitversioncontrol.h
gitversioncontrol.h \
gitsettings.h
SOURCES += gitplugin.cpp \
gitoutputwindow.cpp \
......@@ -30,7 +31,8 @@ SOURCES += gitplugin.cpp \
annotationhighlighter.cpp \
gitsubmiteditorwidget.cpp \
gitsubmiteditor.cpp \
gitversioncontrol.cpp
gitversioncontrol.cpp \
gitsettings.cpp
FORMS += changeselectiondialog.ui \
settingspage.ui \
......
......@@ -88,6 +88,8 @@ GitClient::GitClient(GitPlugin* plugin, Core::ICore *core) :
m_plugin(plugin),
m_core(core)
{
if (QSettings *s = m_core->settings())
m_settings.fromSettings(s);
}
GitClient::~GitClient()
......@@ -178,7 +180,7 @@ void GitClient::diff(const QString &workingDirectory, const QStringList &fileNam
const QString title = tr("Git Diff");
VCSBase::VCSBaseEditor *editor = createVCSEditor(kind, title, workingDirectory, true, "originalFileName", workingDirectory);
executeGit(workingDirectory, arguments, m_plugin->m_outputWindow, editor);
executeGit(workingDirectory, arguments, m_plugin->outputWindow(), editor);
}
......@@ -196,27 +198,26 @@ void GitClient::diff(const QString &workingDirectory, const QString &fileName)
const QString sourceFile = source(workingDirectory, fileName);
VCSBase::VCSBaseEditor *editor = createVCSEditor(kind, title, sourceFile, true, "originalFileName", sourceFile);
executeGit(workingDirectory, arguments, m_plugin->m_outputWindow, editor);
executeGit(workingDirectory, arguments, m_plugin->outputWindow(), editor);
}
void GitClient::status(const QString &workingDirectory)
{
QStringList statusArgs(QLatin1String("status"));
statusArgs << QLatin1String("-u");
executeGit(workingDirectory, statusArgs, m_plugin->m_outputWindow, 0,true);
executeGit(workingDirectory, statusArgs, m_plugin->outputWindow(), 0,true);
}
void GitClient::log(const QString &workingDirectory, const QString &fileName)
{
if (Git::Constants::debug)
qDebug() << "log" << workingDirectory << fileName;
QStringList arguments;
int logCount = 10;
if (m_plugin->m_settingsPage && m_plugin->m_settingsPage->logCount() > 0)
logCount = m_plugin->m_settingsPage->logCount();
arguments << QLatin1String("log") << QLatin1String("-n")
<< QString::number(logCount);
QStringList arguments(QLatin1String("log"));
if (m_settings.logCount > 0)
arguments << QLatin1String("-n") << QString::number(m_settings.logCount);
if (!fileName.isEmpty())
arguments << fileName;
......@@ -224,7 +225,7 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName)
const QString kind = QLatin1String(Git::Constants::GIT_LOG_EDITOR_KIND);
const QString sourceFile = source(workingDirectory, fileName);
VCSBase::VCSBaseEditor *editor = createVCSEditor(kind, title, sourceFile, false, "logFileName", sourceFile);
executeGit(workingDirectory, arguments, m_plugin->m_outputWindow, editor);
executeGit(workingDirectory, arguments, m_plugin->outputWindow(), editor);
}
void GitClient::show(const QString &source, const QString &id)
......@@ -240,7 +241,7 @@ void GitClient::show(const QString &source, const QString &id)
const QFileInfo sourceFi(source);
const QString workDir = sourceFi.isDir() ? sourceFi.absoluteFilePath() : sourceFi.absolutePath();
executeGit(workDir, arguments, m_plugin->m_outputWindow, editor);
executeGit(workDir, arguments, m_plugin->outputWindow(), editor);
}
void GitClient::blame(const QString &workingDirectory, const QString &fileName)
......@@ -255,7 +256,7 @@ void GitClient::blame(const QString &workingDirectory, const QString &fileName)
const QString sourceFile = source(workingDirectory, fileName);
VCSBase::VCSBaseEditor *editor = createVCSEditor(kind, title, sourceFile, true, "blameFileName", sourceFile);
executeGit(workingDirectory, arguments, m_plugin->m_outputWindow, editor);
executeGit(workingDirectory, arguments, m_plugin->outputWindow(), editor);
}
void GitClient::checkout(const QString &workingDirectory, const QString &fileName)
......@@ -269,7 +270,7 @@ void GitClient::checkout(const QString &workingDirectory, const QString &fileNam
arguments << QLatin1String("checkout") << QLatin1String("HEAD") << QLatin1String("--")
<< fileName;
executeGit(workingDirectory, arguments, m_plugin->m_outputWindow, 0,true);
executeGit(workingDirectory, arguments, m_plugin->outputWindow(), 0,true);
}
void GitClient::hardReset(const QString &workingDirectory, const QString &commit)
......@@ -279,7 +280,7 @@ void GitClient::hardReset(const QString &workingDirectory, const QString &commit
if (!commit.isEmpty())
arguments << commit;
executeGit(workingDirectory, arguments, m_plugin->m_outputWindow, 0,true);
executeGit(workingDirectory, arguments, m_plugin->outputWindow(), 0,true);
}
void GitClient::addFile(const QString &workingDirectory, const QString &fileName)
......@@ -287,7 +288,7 @@ void GitClient::addFile(const QString &workingDirectory, const QString &fileName
QStringList arguments;
arguments << QLatin1String("add") << fileName;
executeGit(workingDirectory, arguments, m_plugin->m_outputWindow, 0,true);
executeGit(workingDirectory, arguments, m_plugin->outputWindow(), 0,true);
}
bool GitClient::synchronousAdd(const QString &workingDirectory, const QStringList &files)
......@@ -302,8 +303,8 @@ bool GitClient::synchronousAdd(const QString &workingDirectory, const QStringLis
if (!rc) {
const QString errorMessage = tr("Unable to add %n file(s) to %1: %2", 0, files.size()).
arg(workingDirectory, QString::fromLocal8Bit(errorText));
m_plugin->m_outputWindow->append(errorMessage);
m_plugin->m_outputWindow->popup(false);
m_plugin->outputWindow()->append(errorMessage);
m_plugin->outputWindow()->popup(false);
}
return rc;
}
......@@ -319,14 +320,14 @@ bool GitClient::synchronousReset(const QString &workingDirectory,
arguments << QLatin1String("reset") << QLatin1String("HEAD") << QLatin1String("--") << files;
const bool rc = synchronousGit(workingDirectory, arguments, &outputText, &errorText);
const QString output = QString::fromLocal8Bit(outputText);
m_plugin->m_outputWindow->popup(false);
m_plugin->m_outputWindow->append(output);
m_plugin->outputWindow()->popup(false);
m_plugin->outputWindow()->append(output);
// Note that git exits with 1 even if the operation is successful
// Assume real failure if the output does not contain "foo.cpp modified"
if (!rc && !output.contains(QLatin1String("modified"))) {
const QString errorMessage = tr("Unable to reset %n file(s) in %1: %2", 0, files.size()).
arg(workingDirectory, QString::fromLocal8Bit(errorText));
m_plugin->m_outputWindow->append(errorMessage);
m_plugin->outputWindow()->append(errorMessage);
return false;
}
return true;
......@@ -339,13 +340,13 @@ void GitClient::executeGit(const QString &workingDirectory, const QStringList &a
if (Git::Constants::debug)
qDebug() << "executeGit" << workingDirectory << arguments << editor;
m_plugin->m_outputWindow->append(formatCommand(QLatin1String(kGitCommand), arguments));
m_plugin->outputWindow()->append(formatCommand(QLatin1String(kGitCommand), arguments));
QProcess process;
ProjectExplorer::Environment environment = ProjectExplorer::Environment::systemEnvironment();
if (m_plugin->m_settingsPage && !m_plugin->m_settingsPage->adoptEnvironment())
environment.set(QLatin1String("PATH"), m_plugin->m_settingsPage->path());
if (m_settings.adoptPath)
environment.set(QLatin1String("PATH"), m_settings.path);
GitCommand* command = new GitCommand();
if (outputToWindow) {
......@@ -373,14 +374,14 @@ bool GitClient::synchronousGit(const QString &workingDirectory
qDebug() << "synchronousGit" << workingDirectory << arguments;
const QString binary = QLatin1String(kGitCommand);
m_plugin->m_outputWindow->append(formatCommand(binary, arguments));
m_plugin->outputWindow()->append(formatCommand(binary, arguments));
QProcess process;
process.setWorkingDirectory(workingDirectory);
ProjectExplorer::Environment environment = ProjectExplorer::Environment::systemEnvironment();
if (m_plugin->m_settingsPage && !m_plugin->m_settingsPage->adoptEnvironment())
environment.set(QLatin1String("PATH"), m_plugin->m_settingsPage->path());
if (m_settings.adoptPath)
environment.set(QLatin1String("PATH"), m_settings.path);
process.setEnvironment(environment.toStringList());
process.start(binary, arguments);
......@@ -417,6 +418,34 @@ static inline QString trimFileSpecification(QString fileSpec)
return fileSpec;
}
GitClient::StatusResult GitClient::gitStatus(const QString &workingDirectory,
bool untracked,
QString *output,
QString *errorMessage)
{
// Run 'status'. Note that git returns exitcode 1 if there are no added files.
QByteArray outputText;
QByteArray errorText;
QStringList statusArgs(QLatin1String("status"));
if (untracked)
statusArgs << QLatin1String("-u");
const bool statusRc = synchronousGit(workingDirectory, statusArgs, &outputText, &errorText);
if (output)
*output = QString::fromLocal8Bit(outputText).remove(QLatin1Char('\r'));
// Is it something really fatal?
if (!statusRc && !outputText.contains(kBranchIndicatorC)) {
if (errorMessage) {
const QString error = QString::fromLocal8Bit(errorText).remove(QLatin1Char('\r'));
*errorMessage = tr("Unable to obtain the status: %1").arg(error);
}
return StatusFailed;
}
// Unchanged?
if (outputText.contains("nothing to commit"))
return StatusUnchanged;
return StatusChanged;
}
/* Parse a git status file list:
* \code
# Changes to be committed:
......@@ -517,24 +546,15 @@ bool GitClient::getCommitData(const QString &workingDirectory,
}
// Run status. Note that it has exitcode 1 if there are no added files.
QByteArray outputText;
QByteArray errorText;
QStringList statusArgs(QLatin1String("status"));
if (untrackedFilesInCommit)
statusArgs << QLatin1String("-u");
const bool statusRc = synchronousGit(repoDirectory, statusArgs, &outputText, &errorText);
if (!statusRc) {
// Something fatal
if (!outputText.contains(kBranchIndicatorC)) {
*errorMessage = tr("Unable to obtain the project status: %1").arg(QString::fromLocal8Bit(errorText));
return false;
}
// All unchanged
if (outputText.contains("nothing to commit")) {
*errorMessage = tr("There are no modified files.");
return false;
}
QString output;
switch (gitStatus(repoDirectory, untrackedFilesInCommit, &output, errorMessage)) {
case StatusChanged:
break;
case StatusUnchanged:
*errorMessage = tr("There are no modified files.");
return false;
case StatusFailed:
return false;
}
// Output looks like:
......@@ -555,7 +575,7 @@ bool GitClient::getCommitData(const QString &workingDirectory,
// #
// # list of files...
const QStringList lines = QString::fromLocal8Bit(outputText).remove(QLatin1Char('\r')).split(QLatin1Char('\n'));
const QStringList lines = output.split(QLatin1Char('\n'));
if (!parseFiles(lines, d)) {
*errorMessage = tr("Unable to parse the file output.");
return false;
......@@ -610,22 +630,62 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
QByteArray errorText;
const bool rc = synchronousGit(repositoryDirectory, args, &outputText, &errorText);
const QString message = rc ?
tr("Committed %n file(s).", 0, checkedFiles.size()) :
tr("Unable to commit %n file(s): %1", 0, checkedFiles.size()).arg(QString::fromLocal8Bit(errorText));
tr("Committed %n file(s).\n", 0, checkedFiles.size()) :
tr("Unable to commit %n file(s): %1\n", 0, checkedFiles.size()).arg(QString::fromLocal8Bit(errorText));
m_plugin->m_outputWindow->append(message);
m_plugin->m_outputWindow->popup(false);
m_plugin->outputWindow()->append(message);
m_plugin->outputWindow()->popup(false);
return rc;
}
void GitClient::pull(const QString &workingDirectory)
{
executeGit(workingDirectory, QStringList(QLatin1String("pull")), m_plugin->m_outputWindow, 0,true);
executeGit(workingDirectory, QStringList(QLatin1String("pull")), m_plugin->outputWindow(), 0, true);
}
void GitClient::push(const QString &workingDirectory)
{
executeGit(workingDirectory, QStringList(QLatin1String("push")), m_plugin->m_outputWindow, 0,true);
executeGit(workingDirectory, QStringList(QLatin1String("push")), m_plugin->outputWindow(), 0, true);
}
void GitClient::stash(const QString &workingDirectory)
{
// Check for changes and stash
QString errorMessage;
switch (gitStatus(workingDirectory, false, 0, &errorMessage)) {
case StatusChanged:
executeGit(workingDirectory, QStringList(QLatin1String("stash")), m_plugin->outputWindow(), 0, true);
break;
case StatusUnchanged:
m_plugin->outputWindow()->append(tr("There are no modified files."));
m_plugin->outputWindow()->popup();
break;
case StatusFailed:
m_plugin->outputWindow()->append(errorMessage);
m_plugin->outputWindow()->popup();
break;
}
}
void GitClient::stashPop(const QString &workingDirectory)
{
QStringList arguments(QLatin1String("stash"));
arguments << QLatin1String("pop");
executeGit(workingDirectory, arguments, m_plugin->outputWindow(), 0, true);
}
void GitClient::branchList(const QString &workingDirectory)
{
QStringList arguments(QLatin1String("branch"));
arguments << QLatin1String("-r");
executeGit(workingDirectory, arguments, m_plugin->outputWindow(), 0, true);
}
void GitClient::stashList(const QString &workingDirectory)
{
QStringList arguments(QLatin1String("stash"));
arguments << QLatin1String("list");
executeGit(workingDirectory, arguments, m_plugin->outputWindow(), 0, true);
}
QString GitClient::readConfig(const QString &workingDirectory, const QStringList &configVar)
......@@ -645,6 +705,21 @@ QString GitClient::readConfigValue(const QString &workingDirectory, const QStrin
return readConfig(workingDirectory, QStringList(configVar)).remove(QLatin1Char('\n'));
}
GitSettings GitClient::settings() const
{
return m_settings;
}
void GitClient::setSettings(const GitSettings &s)
{
if (s != m_settings) {
m_settings = s;
if (QSettings *s = m_core->settings())
m_settings.toSettings(s);
}
}
// ------------------------ GitCommand
GitCommand::GitCommand()
{
}
......
......@@ -34,6 +34,8 @@
#ifndef GITCLIENT_H
#define GITCLIENT_H
#include "gitsettings.h"
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/editormanager/ieditor.h>
#include <projectexplorer/environment.h>
......@@ -91,6 +93,11 @@ public:
void pull(const QString &workingDirectory);
void push(const QString &workingDirectory);
void stash(const QString &workingDirectory);
void stashPop(const QString &workingDirectory);
void branchList(const QString &workingDirectory);
void stashList(const QString &workingDirectory);
QString readConfig(const QString &workingDirectory, const QStringList &configVar);
QString readConfigValue(const QString &workingDirectory, const QString &configVar);
......@@ -106,10 +113,19 @@ public:
const QStringList &checkedFiles,
const QStringList &origCommitFiles);
GitSettings settings() const;
void setSettings(const GitSettings &s);
public slots:
void show(const QString &source, const QString &id);
private:
enum StatusResult { StatusChanged, StatusUnchanged, StatusFailed };
StatusResult gitStatus(const QString &workingDirectory,
bool untracked,
QString *output = 0,
QString *errorMessage = 0);
VCSBase::VCSBaseEditor *createVCSEditor(const QString &kind,
QString title,
const QString &source,
......@@ -132,6 +148,7 @@ private:
const QString m_msgWait;
GitPlugin *m_plugin;
Core::ICore *m_core;
GitSettings m_settings;
};
class GitCommand : public QObject
......
......@@ -104,6 +104,7 @@ void GitOutputWindow::append(const QString &text)
const QStringList lines = text.split(QLatin1Char('\n'));
foreach (const QString &s, lines)
m_outputListWidget->addItem(s);
m_outputListWidget->scrollToBottom();
popup();
}
......
......@@ -126,6 +126,10 @@ GitPlugin::GitPlugin() :
m_diffSelectedFilesAction(0),
m_undoAction(0),
m_redoAction(0),
m_stashAction(0),
m_stashPopAction(0),
m_stashListAction(0),
m_branchListAction(0),
m_projectExplorer(0),
m_gitClient(0),
m_outputWindow(0),
......@@ -206,6 +210,15 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
Git::Constants::DIFF_SELECTED
};
static inline Core::ICommand *createSeparator(Core::ActionManagerInterface *am,
const QList<int> &context,
const QString &id,
QObject *parent)
{
QAction *a = new QAction(parent);
a->setSeparator(true);
return am->registerAction(a, id, context);
}
bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
{
......@@ -262,7 +275,6 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
}
Core::ICommand *command;
QAction *tmpaction;
m_diffAction = new QAction(tr("Diff current file"), this);
command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext);
......@@ -306,10 +318,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addFile()));
gitContainer->addAction(command);
tmpaction = new QAction(this);
tmpaction->setSeparator(true);
command = actionManager->registerAction(tmpaction, QLatin1String("Git.Sep.Project"), globalcontext);
gitContainer->addAction(command);
gitContainer->addAction(createSeparator(actionManager, globalcontext, QLatin1String("Git.Sep.Project"), this));
m_diffProjectAction = new QAction(tr("Diff current project"), this);
command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext);
......@@ -337,15 +346,26 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
connect(m_undoProjectAction, SIGNAL(triggered()), this, SLOT(undoProjectChanges()));
gitContainer->addAction(command);
tmpaction = new QAction(this);
tmpaction->setSeparator(true);
command = actionManager->registerAction(tmpaction, QLatin1String("Git.Sep.Global"), globalcontext);
gitContainer->addAction(createSeparator(actionManager, globalcontext, QLatin1String("Git.Sep.Global"), this));
m_stashAction = new QAction(tr("Stash"), this);
m_stashAction->setToolTip("Saves the current state of your work.");
command = actionManager->registerAction(m_stashAction, "Git.Stash", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
connect(m_stashAction, SIGNAL(triggered()), this, SLOT(stash()));
gitContainer->addAction(command);
m_showAction = new QAction(tr("Show commit..."), this);
command = actionManager->registerAction(m_showAction, "Git.ShowCommit", globalcontext);
m_pullAction = new QAction(tr("Pull"), this);
command = actionManager->registerAction(m_pullAction, "Git.Pull", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
connect(m_showAction, SIGNAL(triggered()), this, SLOT(showCommit()));
connect(m_pullAction, SIGNAL(triggered()), this, SLOT(pull()));
gitContainer->addAction(command);
m_stashPopAction = new QAction(tr("Stash pop"), this);
m_stashAction->setToolTip("Restores changes saved to the stash list using \"Stash\".");
command = actionManager->registerAction(m_stashPopAction, "Git.StashPop", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
connect(m_stashPopAction, SIGNAL(triggered()), this, SLOT(stashPop()));
gitContainer->addAction(command);
m_commitAction = new QAction(tr("Commit..."), this);
......@@ -355,24 +375,37 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
connect(m_commitAction, SIGNAL(triggered()), this, SLOT(startCommit()));
gitContainer->addAction(command);
m_pullAction = new QAction(tr("Pull"), this);
command = actionManager->registerAction(m_pullAction, "Git.Pull", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
connect(m_pullAction, SIGNAL(triggered()), this, SLOT(pull()));
gitContainer->addAction(command);
m_pushAction = new QAction(tr("Push"), this);
command = actionManager->registerAction(m_pushAction, "Git.Push", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
connect(m_pushAction, SIGNAL(triggered()), this, SLOT(push()));
gitContainer->addAction(command);
gitContainer->addAction(createSeparator(actionManager, globalcontext, QLatin1String("Git.Sep.Branch"), this));
m_branchListAction = new QAction(tr("List branches"), this);
command = actionManager->registerAction(m_branchListAction, "Git.BranchList", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
connect(m_branchListAction, SIGNAL(triggered()), this, SLOT(branchList()));
gitContainer->addAction(command);
m_stashListAction = new QAction(tr("List stashes"), this);
command = actionManager->registerAction(m_stashListAction, "Git.StashList", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
connect(m_stashListAction, SIGNAL(triggered()), this, SLOT(stashList()));
gitContainer->addAction(command);
m_showAction = new QAction(tr("Show commit..."), this);
command = actionManager->registerAction(m_showAction, "Git.ShowCommit", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
connect(m_showAction, SIGNAL(triggered()), this, SLOT(showCommit()));
gitContainer->addAction(command);
// Submit editor
QList<int> submitContext;
submitContext.push_back(m_core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Constants::C_GITSUBMITEDITOR)));
m_submitCurrentAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = actionManager->registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
// TODO
connect(m_submitCurrentAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
m_diffSelectedFilesAction = new QAction(VCSBase::VCSBaseSubmitEditor::diffIcon(), tr("Diff Selected Files"), this);
......@@ -421,7 +454,7 @@ void GitPlugin::diffCurrentProject()
m_gitClient->diff(workingDirectory, QString());
}
QFileInfo GitPlugin::currentFile()
QFileInfo GitPlugin::currentFile() const
{
QString fileName = m_core->fileManager()->currentFile();
QFileInfo fileInfo(fileName);
......@@ -636,26 +669,52 @@ bool GitPlugin::editorAboutToClose(Core::IEditor *iEditor)
void GitPlugin::pull()
{
QString workingDirectory = getWorkingDirectory();
if (workingDirectory.isEmpty())
return;
m_gitClient->pull(workingDirectory);
const QString workingDirectory = getWorkingDirectory();
if (!workingDirectory.isEmpty())
m_gitClient->pull(workingDirectory);
}
void GitPlugin::push()
{
QString workingDirectory = getWorkingDirectory();
if (workingDirectory.isEmpty())
return;
m_gitClient->push(workingDirectory);
const QString workingDirectory = getWorkingDirectory();
if (!workingDirectory.isEmpty())
m_gitClient->push(workingDirectory);
}
void GitPlugin::stash()
{
const QString workingDirectory = getWorkingDirectory();
if (!workingDirectory.isEmpty())
m_gitClient->stash(workingDirectory);
}
void GitPlugin::stashPop()
{
const QString workingDirectory = getWorkingDirectory();
if (!workingDirectory.isEmpty())
m_gitClient->stashPop(workingDirectory);
}
void GitPlugin::branchList()
{
const QString workingDirectory = getWorkingDirectory();
if (!workingDirectory.isEmpty())
m_gitClient->branchList(workingDirectory);
}
void GitPlugin::stashList()
{
const QString workingDirectory = getWorkingDirectory();
if (!workingDirectory.isEmpty())
m_gitClient->stashList(workingDirectory);
}
void GitPlugin::updateActions()
{
QFileInfo current = currentFile();
const QFileInfo current = currentFile();
const QString fileName = current.fileName();
const QString currentDirectory = getWorkingDirectory();
QString repository = m_gitClient->findRepositoryForFile(current.absoluteFilePath());
const QString repository = m_gitClient->findRepositoryForFile(current.absoluteFilePath());