-
Notifications
You must be signed in to change notification settings - Fork 266
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
git-changebar: fix compatibility with libgit2 0.28 API #821
Conversation
This needs to select which name to use depending on the version of libgit the plugin is being built against. |
Ok they have been guarded under #if LIBGIT2_VER_MAJOR == 0 && LIBGIT2_VER_MINOR >= 28
/* new api */
#else
/* old api */
#endif |
According to the release notes API removals for 0.28, the old names are being kept for backward compatibility "for the foreseeable future", so this isn't really needed. |
I didn't check the new API yet, but it's probably good to use it. But I'd rather see a backward compatibility chunk like there's around line 35, and change the code to use the new name. |
I removed the individual checks and added a block that defines git_buf_dispose to git_buf_free and git_error_last to giterr_last when libgit2 version is under 0.28.0 |
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.
Otherwise looks good, although I didn't test it yet (will try to do tomorrow).
Namely rename the deprecated git_buf_free to git_buf_dispose and change giterr calls to git_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.
Works fine with 0.27 and 0.28, and indeed fixes support for a naive libgit2 build (which is not too nice on their part, but well… might actually be a bug).
👍 |
Namely rename the deprecated git_buf_free to git_buf_dispose and change
giterr calls to git_error.