diff --git a/decloud/core/system.py b/decloud/core/system.py
index 7101a6591e8f12a83c0250fb2718d50af2462ecb..17da552bc9c24ff3a0ffab1c6fad13458ba9fc34 100644
--- a/decloud/core/system.py
+++ b/decloud/core/system.py
@@ -46,7 +46,7 @@ def get_commit_hash():
     except TypeError:
         try:
             commit_hash = 'DETACHED_' + repo.head.object.hexsha[0:5]
-        except TypeError:
+        except ValueError:
             commit_hash = 'NoHash'
 
     return commit_hash