GitClient: Call done handlers also in case of an error

This removes the "Precedes: <resolving>" label when
doing git show on a very fresh, local commit.

The same fix applies to "Branches", though not sure if
it's possible that there is no branch.

Change-Id: I08614d47b229bd04256de1a059876d679cc57b99
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2024-07-08 19:33:23 +02:00
parent faff9bb220
commit 6c2c287335

View File

@@ -372,7 +372,6 @@ ShowController::ShowController(IDocument *document, const QString &id)
}; };
const Storage<ReloadStorage> storage; const Storage<ReloadStorage> storage;
const Storage<QString> diffInputStorage;
const auto updateDescription = [this](const ReloadStorage &storage) { const auto updateDescription = [this](const ReloadStorage &storage) {
QString desc = storage.m_header; QString desc = storage.m_header;
@@ -523,13 +522,13 @@ ShowController::ShowController(IDocument *document, const QString &id)
noColorOption, decorateOption, id})); noColorOption, decorateOption, id}));
VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine()); VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine());
}; };
const Storage<QString> diffInputStorage;
const auto onDiffDone = [diffInputStorage](const Process &process) { const auto onDiffDone = [diffInputStorage](const Process &process) {
*diffInputStorage = process.cleanedStdOut(); *diffInputStorage = process.cleanedStdOut();
}; };
const Group root { const Group root {
storage, storage,
diffInputStorage,
parallel, parallel,
onGroupSetup([this] { setStartupFile(VcsBase::source(this->document()).toString()); }), onGroupSetup([this] { setStartupFile(VcsBase::source(this->document()).toString()); }),
Group { Group {
@@ -539,12 +538,13 @@ ShowController::ShowController(IDocument *document, const QString &id)
parallel, parallel,
finishAllAndSuccess, finishAllAndSuccess,
onGroupSetup(desciptionDetailsSetup), onGroupSetup(desciptionDetailsSetup),
ProcessTask(onBranchesSetup, onBranchesDone, CallDoneIf::Success), ProcessTask(onBranchesSetup, onBranchesDone),
ProcessTask(onPrecedesSetup, onPrecedesDone, CallDoneIf::Success), ProcessTask(onPrecedesSetup, onPrecedesDone),
TaskTreeTask(onFollowsSetup) TaskTreeTask(onFollowsSetup)
} }
}, },
Group { Group {
diffInputStorage,
ProcessTask(onDiffSetup, onDiffDone, CallDoneIf::Success), ProcessTask(onDiffSetup, onDiffDone, CallDoneIf::Success),
postProcessTask(diffInputStorage) postProcessTask(diffInputStorage)
} }