Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Git command failures #16

Open
1 task done
edudobay opened this issue May 10, 2019 · 0 comments
Open
1 task done

Handle Git command failures #16

edudobay opened this issue May 10, 2019 · 0 comments
Projects

Comments

@edudobay
Copy link
Owner

edudobay commented May 10, 2019

Cases to handle

Example

When an invalid ref (e.g. non-existent branch) is given, we get this (solved by #33):

> Fetching from default remote
fatal: Needed a single revision
Traceback (most recent call last):
  File "/usr/local/bin/simple-git-deploy", line 11, in <module>
    sys.exit(main())
  File "/opt/pyenv/virtualenvs/tools/lib/python3.6/site-packages/simple_git_deploy/cli.py", line 52, in main
    args.func(args, config, reporter)
  File "/opt/pyenv/virtualenvs/tools/lib/python3.6/site-packages/simple_git_deploy/cmd_deploy.py", line 11, in cmd_deploy
    reporter=reporter
  File "/opt/pyenv/virtualenvs/tools/lib/python3.6/site-packages/simple_git_deploy/core.py", line 145, in prepare_new_tree
    hash = git_rev_parse_short(git_ref, git_dir)
  File "/opt/pyenv/virtualenvs/tools/lib/python3.6/site-packages/simple_git_deploy/core.py", line 122, in git_rev_parse_short
    encoding='utf-8',
  File "/opt/pyenv/versions/3.6.8/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/opt/pyenv/versions/3.6.8/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'rev-parse', '--short', 'hotfix/update_whippet_booking_to_order^{commit}']' returned non-zero exit status 128.

Instead we should get a friendly error message.

@edudobay edudobay added this to Refine in Backlog May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Backlog
  
Refine
Development

No branches or pull requests

1 participant