Oid: make sure not to dereference a NULL git_oid #9

Merged
carlosmn merged 1 commits from nil-oid into master 2013-03-08 09:09:44 -06:00
carlosmn commented 2013-03-08 09:08:09 -06:00 (Migrated from github.com)

Some calls like Reference.Target() can return NULL if the reference is
symbolic. Make sure newOidFromC() can handle these situations.


I couldn't decide whether we should return nil or a zeroed Oid in this case. A zeroed id won't make you segfault, but it could lead to the code assuming it has a proper id. Thoughts?

Some calls like Reference.Target() can return NULL if the reference is symbolic. Make sure newOidFromC() can handle these situations. --- I couldn't decide whether we should return nil or a zeroed Oid in this case. A zeroed id won't make you segfault, but it could lead to the code assuming it has a proper id. Thoughts?
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jcarr/git2go#9
No description provided.