Merge pull request #34462 from terminalmage/git-describe-always

Use --always when available to git describe
This commit is contained in:
Mike Place 2016-07-05 21:59:33 -06:00 committed by GitHub
commit e2f576e847

View File

@ -1350,7 +1350,10 @@ def describe(cwd, rev='HEAD', user=None, ignore_retcode=False):
cwd = _expand_path(cwd, user)
if not isinstance(rev, six.string_types):
rev = str(rev)
command = ['git', 'describe', rev]
command = ['git', 'describe']
if _LooseVersion(version(versioninfo=False)) >= _LooseVersion('1.5.6'):
command.append('--always')
command.append(rev)
return _git_run(command,
cwd=cwd,
runas=user,