|
@@ -295,7 +295,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
|
|
|
pieces["closest-tag"] = None
|
|
pieces["closest-tag"] = None
|
|
|
count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"],
|
|
count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"],
|
|
|
cwd=root)
|
|
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()
|
|
# commit date: see ISO-8601 comment in git_versions_from_keywords()
|
|
|
date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"],
|
|
date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"],
|