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

Make libgit2 print repo path on error #21344

Closed
wants to merge 1 commit into from

Conversation

ihnorton
Copy link
Member

The error messages in #17994 occur because a package folder is not actually a git repository, is a bare repo (no commits), or apparently some other reasons. I had about 10 of those for various reasons, and the error messages were not helpful.

Pending more useful errors, this PR prints the libgit2 repo directory when something goes wrong, so that the problem can at least be tracked down manually.

context-free error messages are ... not helpful
@@ -96,7 +99,7 @@ macro check(git_func)
local err::Cint
err = $(esc(git_func::Expr))
if err < 0
throw(Error.GitError(err))
throw(Error.GitError(err; path = gitdir($(esc(:repo)))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are a few places @check is used in functions that don't have a repo argument, like some of the GitConfig constructors

@ararslan ararslan added domain:error handling Handling of exceptions by Julia or the user libgit2 The libgit2 library or the LibGit2 stdlib module labels Apr 11, 2017
@musm
Copy link
Contributor

musm commented Dec 19, 2020

obsolete with the new Pkg manager.

@musm musm closed this Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:error handling Handling of exceptions by Julia or the user libgit2 The libgit2 library or the LibGit2 stdlib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants