Skip to content

gpgsig not populated correctly #500

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

Closed
jamesmkwan opened this issue Aug 20, 2016 · 1 comment
Closed

gpgsig not populated correctly #500

jamesmkwan opened this issue Aug 20, 2016 · 1 comment

Comments

@jamesmkwan
Copy link

Unlike the other attributes in a Commit object, the attribute gpgsig is always set by the Commit constructor. If you look at all the previous lines, they are guarded with a if X is not None:.

Since the Commit object can then be created with gpgsig = None, this causes the __getattr__ in LazyMixin to not be called, which is responsible for calling _set_cache_ which ultimately calls _deserialize to populate gpgsig.

This unfortunately causes the bug that if gpgsig is the first attribute read, it returns None even when the commit is signed. For example, if before reading gpgsig, we read another attribute like message, reading gpgsig will work. This made the bug hard to discover and debug. 😞

I believe that this bug can be fixed just by adding a if gpgsig is not None: conditional in the line above.

@Byron Byron added this to the v2.0.9 - Bugfixes milestone Aug 21, 2016
@Byron Byron closed this as completed in fcfe17e Aug 21, 2016
@Byron
Copy link
Member

Byron commented Aug 21, 2016

Thanks for taking the time to create this super-informative issue.
Provided that travis likes it too, it will be fixed in the next release.

Byron added a commit that referenced this issue Aug 21, 2016
Assure that gpgsig is not initialized with None
to allow the automatic deserialization to kick in.

Fixes #500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants