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

Loading a recipe from newly cloned, empty, repository fails to open because of Git #129

Open
foundry-markf opened this issue Oct 30, 2023 · 1 comment

Comments

@foundry-markf
Copy link
Contributor

foundry-markf commented Oct 30, 2023

  • Create a new Git repository on a server (empty)
  • Clone it locally
  • Add a Conan recipe
  • Try to open that recipe in cruz

The recipe fails to load (silently), but you can see the error on the console

(library_env310) C:\dev\conan_source_patch>python -m cruiz
Traceback (most recent call last):
  File "C:\dev\cruiz\cruiz\mainwindow.py", line 430, in load_recipe
    recipe_widget = RecipeWidget(recipe_path, recipe_uuid, wizard.local_cache)
  File "C:\dev\cruiz\cruiz\recipe\recipewidget.py", line 358, in __init__
    self._create_statusbar()
  File "C:\dev\cruiz\cruiz\recipe\recipewidget.py", line 586, in _create_statusbar
    self._refresh_statusbar()
  File "C:\dev\cruiz\cruiz\recipe\recipewidget.py", line 590, in _refresh_statusbar
    head_sha = self._git_repository.head.object.hexsha
  File "c:\dev\library_env310\lib\site-packages\git\refs\symbolic.py", line 219, in _get_object
    return Object.new_from_sha(self.repo, hex_to_bin(self.dereference_recursive(self.repo, self.path)))
  File "c:\dev\library_env310\lib\site-packages\git\refs\symbolic.py", line 159, in dereference_recursive
    hexsha, ref_path = cls._get_ref_info(repo, ref_path)
  File "c:\dev\library_env310\lib\site-packages\git\refs\symbolic.py", line 210, in _get_ref_info
    return cls._get_ref_info_helper(repo, ref_path)
  File "c:\dev\library_env310\lib\site-packages\git\refs\symbolic.py", line 193, in _get_ref_info_helper
    raise ValueError("Reference at %r does not exist" % ref_path)
ValueError: Reference at 'refs/heads/master' does not exist

Tested in 1.4.0.a4.dev7

@foundry-markf
Copy link
Contributor Author

Doing a commit and push to the upstream resolves this.

However, the initial impression is "What happaned?" when the recipe doesn't show at all.

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

No branches or pull requests

1 participant