Support libgit 1.8.2+

In v1.8.2-rc1, the type change introduced in v1.8.0 was reverted.

See 49d3fadfca
This commit is contained in:
Alex Shvartzkop 2024-10-07 17:11:38 +03:00
parent 473f19e8fb
commit 74e15a3fc2

View File

@ -2304,9 +2304,12 @@ void PROJECT_TREE_PANE::onGitCommit( wxCommandEvent& aEvent )
}
git_oid oid;
// Check if the libgit2 library version is 1.8.0 or higher
#if( LIBGIT2_VER_MAJOR > 1 ) || ( LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 8 )
// For libgit2 version 1.8.0 and above
#if( LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR == 8 \
&& ( LIBGIT2_VER_REVISION == 0 || LIBGIT2_VER_REVISION == 1 ) )
// For libgit2 versions 1.8.0, 1.8.1.
// This change was reverted for 1.8.2+
git_commit* const parents[1] = { parent };
#else
// For libgit2 versions older than 1.8.0