mintproject / mic

Model Insertion Checker
https://mic-cli.readthedocs.io/en/latest/
5 stars 3 forks source link

If MIC is already in a Git tracked file, uploading will not work #343

Closed dgarijo closed 3 years ago

dgarijo commented 3 years ago

Describe the bug If you are already in a folder under git tracking, and try to upload a component to the model catalog, you will see a message similar to the following one:

MIC log:

MIC log file
mic commands.py ERROR Upload failed: failed to create commit: current tip is not the first parent
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/mic/click_encapsulate/commands.py", line 687, in upload
push(mic_config_path.parent, mic_config_path, name, profile)
File "/usr/local/lib/python3.9/site-packages/mic/publisher/github.py", line 80, in push
git_commit(repo)
File "/usr/local/lib/python3.9/site-packages/mic/publisher/github.py", line 132, in git_commit
repo.create_commit('refs/heads/master', author, author, "automated mic", tree, parents)
_pygit2.GitError: failed to create commit: current tip is not the first parent

Expected behavior MIC should detect that the file is already tracked and either push to the same repo, or notify the user and tell them to put the folder in an untracked environment.

mosoriob commented 3 years ago

Thanks for the report. I'm going to review it today.

mosoriob commented 3 years ago

Since version 2.1.0, mic is not using GitHub.