VcsCommand: Limit the usage of setCookie()

Don't use setCookie() for setting the push failure status.
Introduce a PushHandler helper that keeps the data collected
when stdErrText() signal is emitted and reuse it when
finished() is being called. Move m_pushFallbackCommand
field into the helper, as its value is meaningful only
in context of the invoked command.

Hide PushFailure enum inside PushHandler.

Change-Id: Id21457734f32e06bb130c3c07c24cb2b7af6e466
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2022-08-02 09:08:16 +02:00
parent 7b8c053c25
commit 09fb9f3973
2 changed files with 74 additions and 73 deletions

View File

@@ -80,12 +80,6 @@ enum StashFlag {
NoPrompt = 0x02
};
enum PushFailure {
Unknown,
NonFastForward,
NoRemoteBranch
};
class SubmoduleData
{
public:
@@ -425,7 +419,6 @@ private:
QString m_gitQtcEditor;
QMap<Utils::FilePath, StashInfo> m_stashInfo;
QString m_pushFallbackCommand;
QString m_diffCommit;
Utils::FilePaths m_updatedSubmodules;
bool m_disableEditor = false;