mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Don't add 'n/a' because if running from source there will be no git
This commit is contained in:
@@ -333,7 +333,7 @@ def _gitinfo():
|
|||||||
# There is a posibility the .git file to have an absolute path.
|
# There is a posibility the .git file to have an absolute path.
|
||||||
repo_path = os.path.join(repo_path, os.path.relpath(central_gitdir), '.git')
|
repo_path = os.path.join(repo_path, os.path.relpath(central_gitdir), '.git')
|
||||||
except (IOError, AttributeError):
|
except (IOError, AttributeError):
|
||||||
return 'n/a'
|
return ''
|
||||||
f = open(os.path.join(repo_path, "HEAD"))
|
f = open(os.path.join(repo_path, "HEAD"))
|
||||||
branch = f.readline().split('/')[-1].rstrip("\n")
|
branch = f.readline().split('/')[-1].rstrip("\n")
|
||||||
f.close()
|
f.close()
|
||||||
@@ -350,7 +350,7 @@ def _gitinfo():
|
|||||||
result = "({0} {1}) last updated {2} (GMT {3:+04d})".format(branch, commit,
|
result = "({0} {1}) last updated {2} (GMT {3:+04d})".format(branch, commit,
|
||||||
time.strftime("%Y/%m/%d %H:%M:%S", date), offset / -36)
|
time.strftime("%Y/%m/%d %H:%M:%S", date), offset / -36)
|
||||||
else:
|
else:
|
||||||
result = 'n/a'
|
result = ''
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def version(prog):
|
def version(prog):
|
||||||
|
|||||||
Reference in New Issue
Block a user