Skip to content

Commit 0675230

Browse files
committed
Merge pull request #423 from libgit2/bump-libgit2
Bump libgit2 to bring in gitignore fixes
2 parents 8828d01 + ae7a6ca commit 0675230

File tree

7 files changed

+8
-41
lines changed

7 files changed

+8
-41
lines changed

External/libgit2

Submodule libgit2 updated 346 files

ObjectiveGit/GTConfiguration.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,4 @@
4242

4343
- (BOOL)deleteValueForKey:(NSString *)key error:(NSError **)error;
4444

45-
/// Reloads the configuration from the files on disk if they have changed since
46-
/// it was originally loaded.
47-
///
48-
/// error - The error if one occurred.
49-
///
50-
/// Returns whether the refresh was successful.
51-
- (BOOL)refresh:(NSError **)error;
52-
5345
@end

ObjectiveGit/GTConfiguration.m

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ - (NSArray *)remotes {
130130
const char *name = names.strings[i];
131131
git_remote *remote = NULL;
132132

133-
if (git_remote_load(&remote, repository.git_repository, name) == 0) {
133+
if (git_remote_lookup(&remote, repository.git_repository, name) == 0) {
134134
[remotes addObject:[[GTRemote alloc] initWithGitRemote:remote inRepository:repository]];
135135
}
136136
}
@@ -140,17 +140,4 @@ - (NSArray *)remotes {
140140
return remotes;
141141
}
142142

143-
#pragma mark Refresh
144-
145-
- (BOOL)refresh:(NSError **)error {
146-
int success = git_config_refresh(self.git_config);
147-
if (success != GIT_OK) {
148-
if (error != NULL) *error = [NSError git_errorFor:success description:@"Couldn't reload the configuration from disk."];
149-
150-
return NO;
151-
}
152-
153-
return YES;
154-
}
155-
156143
@end

ObjectiveGit/GTRemote.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ typedef enum {
6262
/// `+refs/heads/*:refs/remotes/REMOTE/*`.
6363
@property (nonatomic, readonly, copy) NSArray *pushRefspecs;
6464

65-
/// Tests if a URL is supported (e.g. it's a supported URL scheme)
66-
+ (BOOL)isSupportedURLString:(NSString *)URLString;
67-
6865
/// Tests if a name is valid
6966
+ (BOOL)isValidRemoteName:(NSString *)name;
7067

ObjectiveGit/GTRemote.m

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ + (instancetype)remoteWithName:(NSString *)name inRepository:(GTRepository *)rep
5050
NSParameterAssert(repo != nil);
5151

5252
git_remote *remote;
53-
int gitError = git_remote_load(&remote, repo.git_repository, name.UTF8String);
53+
int gitError = git_remote_lookup(&remote, repo.git_repository, name.UTF8String);
5454
if (gitError != GIT_OK) {
5555
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Remote loading failed" failureReason:nil];
5656

@@ -92,12 +92,6 @@ - (NSUInteger)hash {
9292

9393
#pragma mark API
9494

95-
+ (BOOL)isSupportedURLString:(NSString *)URLString {
96-
NSParameterAssert(URLString != nil);
97-
98-
return git_remote_supported_url(URLString.UTF8String) == GIT_OK;
99-
}
100-
10195
+ (BOOL)isValidRemoteName:(NSString *)name {
10296
NSParameterAssert(name != nil);
10397

@@ -162,7 +156,7 @@ - (BOOL)rename:(NSString *)name error:(NSError **)error {
162156

163157
git_strarray problematic_refspecs;
164158

165-
int gitError = git_remote_rename(&problematic_refspecs, self.git_remote, name.UTF8String);
159+
int gitError = git_remote_rename(&problematic_refspecs, self.repository.git_repository, git_remote_name(self.git_remote), name.UTF8String);
166160
if (gitError != GIT_OK) {
167161
NSArray *problematicRefspecs = [NSArray git_arrayWithStrarray:problematic_refspecs];
168162
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:problematicRefspecs forKey:GTRemoteRenameProblematicRefSpecs];

ObjectiveGit/ObjectiveGit.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
77
//
88

9-
#import "git2/threads.h"
9+
#import "git2/global.h"
1010

1111
__attribute__((constructor))
12-
static void GTSetupThreads(void) {
13-
git_threads_init();
12+
static void GTSetup(void) {
13+
git_libgit2_init();
1414
}

ObjectiveGitTests/GTSubmoduleSpec.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,12 @@
253253

254254
NSString *configKey = @"submodule.Test_App2.url";
255255
NSString *newOrigin = @"https://github.com/libgit2/objective-git.git";
256-
[config setString:newOrigin forKey:configKey];
257256

258-
expect(@([config refresh:NULL])).to(beTruthy());
257+
[config setString:newOrigin forKey:configKey];
259258
expect([config stringForKey:configKey]).to(equal(newOrigin));
260259

261260
__block NSError *error = nil;
262261
expect(@([submodule sync:&error])).to(beTruthy());
263-
264-
expect(@([config refresh:NULL])).to(beTruthy());
265262
expect([config stringForKey:configKey]).to(equal(@"../Test_App"));
266263
});
267264
});

0 commit comments

Comments
 (0)