Description
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.