From 8186705059ac7ff6b20aaae1e8a15ed172051b79 Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Mon, 17 Jan 2022 09:12:41 -0600 Subject: [PATCH] Include Git version with yadm version (#377) --- test/test_version.py | 4 ++-- yadm | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/test_version.py b/test/test_version.py index 08bebe1..2f51f7e 100644 --- a/test/test_version.py +++ b/test/test_version.py @@ -29,8 +29,8 @@ def test_semantic_version(expected_version): @pytest.mark.parametrize('cmd', ['--version', 'version']) def test_reported_version( runner, yadm_cmd, cmd, expected_version): - """Report correct version""" + """Report correct version, include git version""" run = runner(command=yadm_cmd(cmd)) assert run.success assert run.err == '' - assert run.out == f'yadm {expected_version}\n' + assert run.out.startswith(f'yadm version {expected_version}\ngit version') diff --git a/yadm b/yadm index 117c2ca..94aa698 100755 --- a/yadm +++ b/yadm @@ -1413,7 +1413,8 @@ function upgrade() { function version() { - echo "yadm $VERSION" + echo "yadm version $VERSION" + "$GIT_PROGRAM" --version exit_with_hook 0 }