瀏覽代碼

HUE-6080 [metadata] Re-apply avoid none casting in navopt lib versioner

Romain Rigaux 8 年之前
父節點
當前提交
0f0d7fde0b
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      desktop/core/ext-py/navoptapi-0.1.0/altuscli/_version.py

+ 1 - 1
desktop/core/ext-py/navoptapi-0.1.0/altuscli/_version.py

@@ -295,7 +295,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
         pieces["closest-tag"] = None
         count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"],
                                     cwd=root)
-        pieces["distance"] = int(count_out)  # total number of commits
+        pieces["distance"] = int(count_out) if count_out is not None else 0  # total number of commits
 
     # commit date: see ISO-8601 comment in git_versions_from_keywords()
     date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"],