Git: Support reflog also for branches

Change-Id: I9321ba4964d086d90aaf540a2006f95b94de8375
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2020-02-18 23:27:33 +02:00
committed by Orgad Shaneh
parent c9f1d84db7
commit c728d04b52
5 changed files with 29 additions and 8 deletions

View File

@@ -278,6 +278,7 @@ public:
void blameFile();
void logProject();
void logRepository();
void reflogRepository();
void undoFileChanges(bool revertStaging);
void resetRepository();
void recoverDeletedFiles();
@@ -707,7 +708,7 @@ GitPluginPrivate::GitPluginPrivate()
context, true, std::bind(&GitPluginPrivate::logRepository, this));
createRepositoryAction(localRepositoryMenu, tr("Reflog"), "Git.ReflogRepository",
context, true, &GitClient::reflog);
context, true, std::bind(&GitPluginPrivate::reflogRepository, this));
createRepositoryAction(localRepositoryMenu, tr("Clean..."), "Git.CleanRepository",
context, true, [this] { cleanRepository(); });
@@ -1057,6 +1058,13 @@ void GitPluginPrivate::logRepository()
m_gitClient.log(state.topLevel());
}
void GitPluginPrivate::reflogRepository()
{
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
m_gitClient.reflog(state.topLevel());
}
void GitPluginPrivate::undoFileChanges(bool revertStaging)
{
if (IDocument *document = EditorManager::currentDocument()) {