Skip to content

Commit 5b7ea0c

Browse files
author
Ben Chatelain
committed
Merge pull request #472 from libgit2/bump-bump
Bump libgit2
2 parents f780676 + 67444fd commit 5b7ea0c

File tree

7 files changed

+10
-47
lines changed

7 files changed

+10
-47
lines changed

External/libgit2

Submodule libgit2 updated 86 files

ObjectiveGit/GTRepository+RemoteOperations.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ - (BOOL)pushRefspecs:(NSArray *)refspecs toRemote:(GTRemote *)remote withOptions
249249

250250
int update_fetchhead = 1;
251251
// Ignored for push
252-
git_remote_autotag_option_t download_tags = GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK;
252+
git_remote_autotag_option_t download_tags = GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED;
253253
NSString *reflog_message = [NSString stringWithFormat:@"pushing remote %@", remote.name];
254254

255255
gitError = git_remote_update_tips(remote.git_remote, &remote_callbacks, update_fetchhead, download_tags, reflog_message.UTF8String);

ObjectiveGit/GTRepository.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -383,16 +383,6 @@ NS_ASSUME_NONNULL_BEGIN
383383
/// Returns the signature.
384384
- (GTSignature *)userSignatureForNow;
385385

386-
/// Reloads all cached information about the receiver's submodules.
387-
///
388-
/// Existing GTSubmodule objects from this repository will be mutated as part of
389-
/// this operation.
390-
///
391-
/// error - If not NULL, set to any errors that occur.
392-
///
393-
/// Returns whether the reload succeeded.
394-
- (BOOL)reloadSubmodules:(NSError **)error;
395-
396386
/// Enumerates over all the tracked submodules in the repository.
397387
///
398388
/// recursive - Whether to recurse into nested submodules, depth-first.

ObjectiveGit/GTRepository.m

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -674,16 +674,6 @@ static int submoduleEnumerationCallback(git_submodule *git_submodule, const char
674674
return 0;
675675
}
676676

677-
- (BOOL)reloadSubmodules:(NSError **)error {
678-
int gitError = git_submodule_reload_all(self.git_repository, 0);
679-
if (gitError != GIT_OK) {
680-
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to reload submodules."];
681-
return NO;
682-
}
683-
684-
return YES;
685-
}
686-
687677
- (void)enumerateSubmodulesRecursively:(BOOL)recursive usingBlock:(void (^)(GTSubmodule *submodule, NSError *error, BOOL *stop))block {
688678
NSParameterAssert(block != nil);
689679

ObjectiveGit/GTSubmodule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
///
2020
/// These flags are mutually exclusive.
2121
typedef NS_ENUM(NSInteger, GTSubmoduleIgnoreRule) {
22-
GTSubmoduleIgnoreReset = GIT_SUBMODULE_IGNORE_RESET,
22+
GTSubmoduleIgnoreUnspecified = GIT_SUBMODULE_IGNORE_UNSPECIFIED,
2323
GTSubmoduleIgnoreNone = GIT_SUBMODULE_IGNORE_NONE,
2424
GTSubmoduleIgnoreUntracked = GIT_SUBMODULE_IGNORE_UNTRACKED,
2525
GTSubmoduleIgnoreDirty = GIT_SUBMODULE_IGNORE_DIRTY,

ObjectiveGit/GTSubmodule.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ - (GTSubmoduleIgnoreRule)ignoreRule {
2626
}
2727

2828
- (void)setIgnoreRule:(GTSubmoduleIgnoreRule)ignoreRule {
29-
git_submodule_set_ignore(self.git_submodule, (git_submodule_ignore_t)ignoreRule);
29+
git_submodule_set_ignore(self.parentRepository.git_repository, git_submodule_name(self.git_submodule), (git_submodule_ignore_t)ignoreRule);
30+
31+
// The docs for `git_submodule_set_ignore` note "This does not affect any
32+
// currently-loaded instances." So we need to reload.
33+
git_submodule_reload(self.git_submodule, 0);
3034
}
3135

3236
- (GTOID *)indexOID {
@@ -96,7 +100,7 @@ - (instancetype)initWithGitSubmodule:(git_submodule *)submodule parentRepository
96100

97101
- (GTSubmoduleStatus)status:(NSError **)error {
98102
unsigned status;
99-
int gitError = git_submodule_status(&status, self.git_submodule);
103+
int gitError = git_submodule_status(&status, self.parentRepository.git_repository, git_submodule_name(self.git_submodule), git_submodule_ignore(self.git_submodule));
100104
if (gitError != GIT_OK) {
101105
if (error != NULL) *error = [NSError git_errorFor:gitError description:@"Failed to get submodule %@ status.", self.name];
102106
return GTSubmoduleStatusUnknown;

ObjectiveGitTests/GTSubmoduleSpec.m

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@
6767
expect(submodule).notTo(beNil());
6868
expect(@(git_submodule_url(submodule.git_submodule))).notTo(equal(testURLString));
6969

70-
git_submodule_set_url(submodule.git_submodule, testURLString.UTF8String);
71-
git_submodule_save(submodule.git_submodule);
70+
git_submodule_set_url(repo.git_repository, git_submodule_name(submodule.git_submodule), testURLString.UTF8String);
7271

7372
__block NSError *error = nil;
7473
expect(@([submodule writeToParentConfigurationDestructively:YES error:&error])).to(beTruthy());
@@ -79,26 +78,6 @@
7978
expect(@(git_submodule_url(submodule.git_submodule))).to(equal(testURLString));
8079
});
8180

82-
it(@"should reload all submodules", ^{
83-
GTSubmodule *submodule = [repo submoduleWithName:@"new_submodule" error:NULL];
84-
expect(submodule).to(beNil());
85-
86-
NSURL *gitmodulesURL = [repo.fileURL URLByAppendingPathComponent:@".gitmodules"];
87-
NSMutableString *gitmodules = [NSMutableString stringWithContentsOfURL:gitmodulesURL usedEncoding:NULL error:NULL];
88-
expect(gitmodules).notTo(beNil());
89-
90-
[gitmodules appendString:@"[submodule \"new_submodule\"]\n\turl = some_url\n\tpath = new_submodule_path"];
91-
expect(@([gitmodules writeToURL:gitmodulesURL atomically:YES encoding:NSUTF8StringEncoding error:NULL])).to(beTruthy());
92-
93-
__block NSError *error = nil;
94-
expect(@([repo reloadSubmodules:&error])).to(beTruthy());
95-
expect(error).to(beNil());
96-
97-
submodule = [repo submoduleWithName:@"new_submodule" error:NULL];
98-
expect(submodule).notTo(beNil());
99-
expect(submodule.path).to(equal(@"new_submodule_path"));
100-
});
101-
10281
it(@"should add its HEAD to its parent's index", ^{
10382
GTSubmodule *submodule = [repo submoduleWithName:@"Test_App" error:NULL];
10483
expect(submodule).notTo(beNil());

0 commit comments

Comments
 (0)