forked from qt-creator/qt-creator
Git: Support reflog also for branches
Change-Id: I9321ba4964d086d90aaf540a2006f95b94de8375 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
c9f1d84db7
commit
c728d04b52
@@ -1062,20 +1062,24 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName,
|
||||
vcsExec(workingDir, arguments, editor);
|
||||
}
|
||||
|
||||
void GitClient::reflog(const QString &workingDirectory)
|
||||
void GitClient::reflog(const QString &workingDirectory, const QString &ref)
|
||||
{
|
||||
const QString title = tr("Git Reflog \"%1\"").arg(workingDirectory);
|
||||
const Id editorId = Git::Constants::GIT_LOG_EDITOR_ID;
|
||||
VcsBaseEditorWidget *editor = createVcsEditor(editorId, title, workingDirectory, codecFor(CodecLogOutput),
|
||||
"reflogRepository", workingDirectory);
|
||||
// Creating document might change the referenced workingDirectory. Store a copy and use it.
|
||||
const QString workingDir = workingDirectory;
|
||||
VcsBaseEditorWidget *editor = createVcsEditor(editorId, title, workingDir, codecFor(CodecLogOutput),
|
||||
"reflogRepository", workingDir);
|
||||
VcsBaseEditorConfig *argWidget = editor->editorConfig();
|
||||
if (!argWidget) {
|
||||
argWidget = new GitRefLogArgumentsWidget(settings(), editor->toolBar());
|
||||
if (!ref.isEmpty())
|
||||
argWidget->setBaseArguments({ref});
|
||||
connect(argWidget, &VcsBaseEditorConfig::commandExecutionRequested, this,
|
||||
[=] { this->reflog(workingDirectory); });
|
||||
[=] { this->reflog(workingDir, ref); });
|
||||
editor->setEditorConfig(argWidget);
|
||||
}
|
||||
editor->setWorkingDirectory(workingDirectory);
|
||||
editor->setWorkingDirectory(workingDir);
|
||||
|
||||
QStringList arguments = {"reflog", noColorOption, decorateOption};
|
||||
arguments << argWidget->arguments();
|
||||
@@ -1083,7 +1087,7 @@ void GitClient::reflog(const QString &workingDirectory)
|
||||
if (logCount > 0)
|
||||
arguments << "-n" << QString::number(logCount);
|
||||
|
||||
vcsExec(workingDirectory, arguments, editor);
|
||||
vcsExec(workingDir, arguments, editor);
|
||||
}
|
||||
|
||||
// Do not show "0000" or "^32ae4"
|
||||
|
Reference in New Issue
Block a user