- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 934
Is gitdb an implementation detail? #933
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
Comments
Yes, |
Those are GitPython's requirements, though, not my requirements... |
Thanks for posting! I believe this is indeed an issue, and it's worth fixing for better usability and less surprises. I believe everyone would benefit by removing or merging GitDB into GitPython for good, and PRs are very welcome. |
That sounds like a big task... In the meantime, maybe something like this could suffice: try:
gitdb.op()
except gitdb.exc.ODBError as exc:
raise git.exc.GitDBError from exc Actually though, I just realized that GitPython (not GitDB) is raising Line 147 in 23b83cd
So, maybe more like: class BadName(git.exc.GitError, gitdb.exc.BadName):
pass
raise BadName(name) edit: FWIW, my workaround is to catch Line 8 in 23b83cd
|
@tucked Wow, fantastic write up! I would be so happy if this could be fixed for everyone with what seems like a small PR. (Still catching up on emails, maybe the PR is already there) |
This raises
gitdb.exc.BadName
(which is not catchable withgit.exc.GitError
"Base class for all package exceptions").Do I need to catch
gitdb
exceptions too? I don't have a dep ongitdb
otherwise.The text was updated successfully, but these errors were encountered: