poac icon indicating copy to clipboard operation
poac copied to clipboard

workaround for libgit2 1.8 change (again)

Open yaito3014 opened this issue 8 months ago • 1 comments

As git_error_*s are already declared in git2 namespace for older versions of libgit2, it's more favorable to use those identifiers than now deprecated ones, I suppose.

Another approach might be to use git2::git_error_*s always and make them wrap all changes (like below).

namespace git2 {

void
git_error_clear() {
#if ((LIBGIT2_VER_MAJOR < 1) && (LIBGIT2_VER_MINOR < 28)) || ((LIBGIT2_VER_MAJOR >= 1) && (LIBGIT2_VER_MINOR >= 8))
  return ::giterr_clear();
#else
  return ::git_error_clear();
#endif
}

}

yaito3014 avatar Jun 25 '24 06:06 yaito3014