diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index aa4e2b48db389335b46c1ac96774cfc63fe61152..87fb48d6f3c588a8c201d606860ae67d6213e3ec 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -3047,12 +3047,9 @@ bool GitClient::getCommitData(const QString &workingDirectory,
 
     commitData.enablePush = !synchronousRemotesList(repoDirectory).isEmpty();
     if (commitData.enablePush) {
-        switch (checkCommandInProgress(repoDirectory)) {
-        case GitClient::Rebase:
-        case GitClient::RebaseMerge:
+        CommandInProgress commandInProgress = checkCommandInProgress(repoDirectory);
+        if (commandInProgress == Rebase || commandInProgress == RebaseMerge)
             commitData.enablePush = false;
-            break;
-        }
     }
 
     return true;