mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
try_git_describe: Set cwd, not --git-dir.
git describe --dirty requires a working tree, not just a repository. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
Tim Abbott
parent
9962377018
commit
88e90d34b9
@@ -18,10 +18,9 @@ from version import ZULIP_VERSION
|
|||||||
def try_git_describe() -> Optional[str]:
|
def try_git_describe() -> Optional[str]:
|
||||||
try: # nocoverage
|
try: # nocoverage
|
||||||
return subprocess.check_output(
|
return subprocess.check_output(
|
||||||
['git',
|
['git', 'describe', '--tags', '--always', '--dirty', '--long'],
|
||||||
'--git-dir', os.path.join(os.path.dirname(__file__), '../.git'),
|
|
||||||
'describe', '--tags', '--always', '--dirty', '--long'],
|
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
|
cwd=os.path.join(os.path.dirname(__file__), '..'),
|
||||||
).strip().decode('utf-8')
|
).strip().decode('utf-8')
|
||||||
except Exception: # nocoverage
|
except Exception: # nocoverage
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user