-
Notifications
You must be signed in to change notification settings - Fork 280
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
Moar wrapper functions #549
Conversation
Wrapper for git_diff_index_to_index to create diffs from two in-memory indeces.
(Essentially a wrapper around git_merge_commits())
/// Merges the given commit into the receiver in memory and produces the result as | ||
/// an index. | ||
/// | ||
/// otherTree - The commit with which the receiver should be merged with. Cannot be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be otherCommit
/// | ||
/// Returns an index which represents the result of the merge, or nil if an error | ||
/// occurred. | ||
- (nullable GTIndex *)merge:(GTCommit *)otherCommit error:(NSError **)error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't GTCommit
and NSError
need nullability annotation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git_merge_commits() requires second commit to exist, so no.
As for NSError nullability, I've followed the syntax in -[GTTree merge:ancestor:error:] notation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean nonnull GTCommit *
else GTCommit!
is inferred for swift?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, just saw the macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, well the header has NS_ASSUME_NONNULL_BEGIN
on top, so everything assumed to have nonnull
as long as it's not explicitly stated otherwise.
Looks good to me! @pietbrauer Are you 👍? |
I would vote for tests but to me it looks good otherwise. |
Cool, I'ma assign this to you @pietbrauer. Feel free to merge when you're 👍 on it. |
Added wrappers for git_diff_index_to_index() and git_merge_commits().