diff --git a/public_html/deployment/classes/vcs.git.class.php b/public_html/deployment/classes/vcs.git.class.php
index 46eb67fd6ff834e21f6153cea1e8eb6d4bcb85d5..312f957b56900a16797853c5d064004cfe780ed9 100644
--- a/public_html/deployment/classes/vcs.git.class.php
+++ b/public_html/deployment/classes/vcs.git.class.php
@@ -292,8 +292,6 @@ class vcs implements iVcs {
             $this->log(__FUNCTION__." - command ended with rc=$iRc ". '<pre>'.implode("\n", $aOutput).'</pre>', ($iRc==0 ? 'info':'error'));
             if ($iRc == 0) {
 
-                // use cache that getCommitmessageByBranch can access it
-                $this->_aRemoteBranches = $oCache->read();
                 $this->log(__FUNCTION__ . ' start reading all branches');
                 // $this->log(__FUNCTION__ . ' data from cache: <pre>'.print_r($this->_aRemoteBranches, 1).'</pre>');
                 /**
@@ -343,6 +341,9 @@ class vcs implements iVcs {
                 $oCache->delete();
                 $this->_aRemoteBranches = [];
             }
+        } else {
+            // use cache that getCommitmessageByBranch can access it
+            $this->_aRemoteBranches = $oCache->read();
         }
         return $this->_aRemoteBranches;
     }