From dfe1e4a3a2c792ad2b4909120ebb150a669a49cb Mon Sep 17 00:00:00 2001
From: Remi Cresson <remi.cresson@irstea.fr>
Date: Wed, 1 Jun 2022 20:14:21 +0200
Subject: [PATCH] FIX: get hash

---
 decloud/core/system.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/decloud/core/system.py b/decloud/core/system.py
index b481013..7101a65 100644
--- a/decloud/core/system.py
+++ b/decloud/core/system.py
@@ -44,7 +44,10 @@ def get_commit_hash():
     try:
         commit_hash = repo.active_branch.name + "_" + repo.head.object.hexsha[0:5]
     except TypeError:
-        commit_hash = 'DETACHED_' + repo.head.object.hexsha[0:5]
+        try:
+            commit_hash = 'DETACHED_' + repo.head.object.hexsha[0:5]
+        except TypeError:
+            commit_hash = 'NoHash'
 
     return commit_hash
 
@@ -55,7 +58,7 @@ def get_directories(root):
     :param root: root directory
     :return: list of directories
     """
-    return [pathify(root) + item for item in os.listdir(root)]
+    return [os.path.join(root, item) for item in os.listdir(root)]
 
 
 def get_files(directory, ext=None):
-- 
GitLab