From ddd33236be117aa10a5540b680afd8a65044c907 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Fri, 23 Oct 2026 07:42:42 +0200 Subject: [PATCH 1/2] Bump to libgit2 2.0 --- External/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/External/libgit2 b/External/libgit2 index 49e408b3..f28579db 160000 --- a/External/libgit2 +++ b/External/libgit2 @@ -1 +1 @@ -Subproject commit 49e408b3208bc3093757a1c2db938d3590f3f412 +Subproject commit f28579db11737eaa2ced18498e229967a12f1c3f From 7406a53292a112d44375027b370f33460b72bab0 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Fri, 23 Oct 2026 10:05:57 +0200 Subject: [PATCH 2/2] Fix libgit2 2.0 API breaks (object/repo-init enums, GSSAPI link) libgit2 2.0 removed GIT_OBJECT_OFS_DELTA/GIT_OBJECT_REF_DELTA from the public git_object_t enum (pack-internal delta types, never real objects); hardcode their stable numeric values (6/7) instead. GIT_REPOSITORY_INIT_NO_DOTGIT_DIR and git_odb_hash moved to deprecated.h; import it where needed. Disable USE_GSSAPI in the libgit2 CMake build so the static lib doesn't pull in GSS symbols that aren't linked by the Xcode project (macOS auto-detects system Kerberos/GSSAPI via krb5-config). --- ObjectiveGit/GTOID.m | 1 + ObjectiveGit/GTObject.h | 5 +++-- ObjectiveGit/GTRepository.h | 1 + script/update_libgit2 | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ObjectiveGit/GTOID.m b/ObjectiveGit/GTOID.m index 23412df4..45d4741e 100644 --- a/ObjectiveGit/GTOID.m +++ b/ObjectiveGit/GTOID.m @@ -10,6 +10,7 @@ #import "NSError+Git.h" #import "git2/errors.h" +#import "git2/deprecated.h" #import "git2/odb.h" @interface GTOID () { diff --git a/ObjectiveGit/GTObject.h b/ObjectiveGit/GTObject.h index e562e8dc..e8762eb2 100644 --- a/ObjectiveGit/GTObject.h +++ b/ObjectiveGit/GTObject.h @@ -37,8 +37,9 @@ typedef NS_ENUM(int, GTObjectType) { GTObjectTypeTree = GIT_OBJECT_TREE, /**< A tree (directory listing) object. */ GTObjectTypeBlob = GIT_OBJECT_BLOB, /**< A file revision object. */ GTObjectTypeTag = GIT_OBJECT_TAG, /**< An annotated tag object. */ - GTObjectTypeOffsetDelta = GIT_OBJECT_OFS_DELTA,/**< A delta, base is given by an offset. */ - GTObjectTypeRefDelta = GIT_OBJECT_REF_DELTA, /**< A delta, base is given by object id. */ + // Pack-only types are no longer part of libgit2's public object enum. + GTObjectTypeOffsetDelta = 6, /**< A delta, base is given by an offset. */ + GTObjectTypeRefDelta = 7, /**< A delta, base is given by object id. */ }; @class GTRepository; diff --git a/ObjectiveGit/GTRepository.h b/ObjectiveGit/GTRepository.h index d1c4819c..18948e01 100644 --- a/ObjectiveGit/GTRepository.h +++ b/ObjectiveGit/GTRepository.h @@ -36,6 +36,7 @@ #import #import #import +#import #import #import #import diff --git a/script/update_libgit2 b/script/update_libgit2 index faf306e3..ddb9debe 100755 --- a/script/update_libgit2 +++ b/script/update_libgit2 @@ -69,6 +69,7 @@ cmake -DBUILD_SHARED_LIBS:BOOL=OFF \ -DBUILD_TESTS:BOOL=OFF \ -DTHREADSAFE:BOOL=ON \ -DUSE_SSH=libssh2 \ + -DUSE_GSSAPI:BOOL=OFF \ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ .. cmake --build .