Fix two defects left by the libgit2 1.x API migration - #107
Merged
hannesa2 merged 2 commits intoSep 21, 2026
Merged
Conversation
The libgit2 1.x rename touched three call sites in this function and the middle one landed on the options initializer instead of the input one. * Call git_merge_file_input_init for ourInput, matching the ancestor and their-side call sites on either side of it. * Stop overrunning the stack object: the options initializer memcpy's a 48 byte template over a 40 byte git_merge_file_input. Both structs open with a version field of 1, so the version check passed and the mismatch went unreported.
The libgit2 type rename reached every use of git_cred in the file except the property itself, leaving the header promising a method that nothing implements. * Rename the private property to git_credential so its synthesized getter satisfies the declaration in GTCredential.h, and update the two places that read it. * Restore the public accessor: sending -git_credential to a GTCredential raised an unrecognized selector, and the framework built with a -Wincomplete-implementation warning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two call sites that the 1.x rename converted incorrectly, both visible as
compiler warnings on master today.
git_merge_file_input_initforourInputin-contentsOfDiffWithAncestor:ourSide:theirSide:error:. It was callinggit_merge_file_options_init, whose 48 byte template is memcpy'd overthe 40 byte
git_merge_file_input, overrunning the stack object by 8bytes. Both structs open with a version field of 1, so the version
check passed and nothing reported it. The two sibling call sites on
either side of it were converted correctly.
git_credproperty togit_credential,so the accessor
GTCredential.h:90has declared since the renameactually exists. Sending
-git_credentialto a GTCredential raised anunrecognized selector.
Test plan:
442b5dd4and on this branch. Master warns atGTRepository+Merging.m:202(-Wincompatible-pointer-types) andGTCredential.m:46(-Wincomplete-implementation); on this branch bothare gone and the archive succeeds.
not compile against 1.9.x:
NSDataGitSpec.mreadsgit_buf.asize,which 1.x removed, and the "Test project" step in
BuildPR.ymliscommented out.
GTRepositorySpec.m:263does exercise the merge path, soit would have caught the first defect had it been runnable. Happy to
follow up with the test target separately.