diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-09-20 01:16:26 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-09-20 01:16:26 +0200 |
| commit | 13446dbd0a9ea8f791a526bcdca905a0726ff423 (patch) | |
| tree | 61b12736e9d6c26de3c44c81ae169358438cc31e | |
| parent | bc373642471f202f177d78df2b96c91c8159770c (diff) | |
Output just the commit if we fail to ls-remote it.
| -rwxr-xr-x | cdist | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1356,7 +1356,10 @@ def main(): target.command('bash') elif args.command == 'revision': - print(command_and_read('git ls-remote %s/%s.git %s' % (config.get('git_prefix'), args.project, args.checkout))[0].strip()[:10]) + try: + print(command_and_read('git ls-remote %s/%s.git %s' % (config.get('git_prefix'), args.project, args.checkout))[0].strip()[:10]) + except: + print(args.checkout) elif args.command == 'checkout': |
