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

"branch -o json" fails on an empty repository #637

Closed
pfw opened this issue May 31, 2022 · 0 comments · Fixed by #639
Closed

"branch -o json" fails on an empty repository #637

pfw opened this issue May 31, 2022 · 0 comments · Fixed by #639

Comments

@pfw
Copy link
Contributor

pfw commented May 31, 2022

Describe the bug
branch -o json fails on an empty repository

To Reproduce

kart init
kart branch -o json

Expected behaviour
Not a traceback, text format works

kart branch

Output

Traceback (most recent call last):
  File "kart_cli.py", line 4, in <module>
  File "kart/cli.py", line 351, in entrypoint
  File "click/core.py", line 829, in __call__
  File "click/core.py", line 782, in main
  File "kart/cli.py", line 159, in invoke
  File "click/core.py", line 1259, in invoke
  File "click/core.py", line 1066, in invoke
  File "click/core.py", line 610, in invoke
  File "click/decorators.py", line 21, in new_func
  File "kart/branch.py", line 32, in branch
  File "kart/branch.py", line 50, in list_branches_json
_pygit2.GitError: reference 'refs/heads/main' not found
[481] Failed to execute script kart_cli

Version Info

  • OS: Mac OS
  • Version: v0.11.1
@craigds craigds linked a pull request Jun 1, 2022 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant