The repository merge API can return several states: success, failure, or a no-op. The current implementation of
Repository.merge() expects only the first two of these states, and returns a
NullObject if the operation was a no-op or a failed merge.
It seems that this is because
GitHubCore._json() to expect an HTTP 201 with a JSON body. When the API returns a 204 with no body,
None and hence
GitHubCore._instance_or_null() returns a null object.
I'm not sure what the best approach for fixing this issue is... we could return a tuple from
Repository.merge() as follows:
- Successful merge:
@sigmavirus24 any thoughts on this?