Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion External/libgit2
Submodule libgit2 updated 4230 files
6 changes: 4 additions & 2 deletions ObjectiveGit/GTOID.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#import "NSError+Git.h"

#import "git2/errors.h"
#import "git2/odb.h"
#import "git2/object.h"

@interface GTOID () {
git_oid _git_oid;
Expand Down Expand Up @@ -133,7 +133,9 @@ + (instancetype)OIDByHashingData:(NSData *)data type:(GTObjectType)type error:(N
NSParameterAssert(data != nil);

git_oid oid;
int gitError = git_odb_hash(&oid, data.bytes, data.length, (git_object_t)type);
git_object_id_options options = GIT_OBJECT_ID_OPTIONS_INIT;
options.object_type = (git_object_t)type;
int gitError = git_object_id_from_buffer(&oid, data.bytes, data.length, &options);
if (gitError != GIT_OK) {
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to hash"];
return nil;
Expand Down
5 changes: 3 additions & 2 deletions ObjectiveGit/GTObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion ObjectiveGit/GTRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ typedef NS_OPTIONS(NSInteger, GTRepositoryOpenFlags) {
typedef NS_OPTIONS(NSInteger, GTRepositoryInitFlags) {
GTRepositoryInitBare = GIT_REPOSITORY_INIT_BARE,
GTRepositoryInitWithoutReinitializing = GIT_REPOSITORY_INIT_NO_REINIT,
GTRepositoryInitWithoutDotGit = GIT_REPOSITORY_INIT_NO_DOTGIT_DIR,
// In libgit2 1.9.7 this was a real bit (GIT_REPOSITORY_INIT_NO_DOTGIT_DIR,
// (1u << 2)) that stopped ".git" being appended to the given path.
// libgit2 2.0 dropped the flag entirely (`#define ... 0` in
// deprecated.h); the same effect is now implied whenever `workdir_path`
// is set on the init options. Nothing in GitX or this repo uses this
// flag, so it's kept only for source compatibility.
GTRepositoryInitWithoutDotGit __attribute__((deprecated("No longer has any effect since libgit2 2.0; set workdir_path on the init options instead."))) = 0,
GTRepositoryInitCreatingRepositoryDirectory = GIT_REPOSITORY_INIT_MKDIR,
GTRepositoryInitCreatingIntermediateDirectories = GIT_REPOSITORY_INIT_MKPATH,
GTRepositoryInitWithExternalTemplate = GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE,
Expand Down
1 change: 1 addition & 0 deletions script/update_libgit2
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
Loading