-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweaks #587
Tweaks #587
Conversation
ObjectiveGit/GTBranch.h
Outdated
@@ -62,15 +64,15 @@ NS_ASSUME_NONNULL_BEGIN | |||
/// repo - The repository containing the branch. Must not be nil. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation should be updated after the repo
arg is no longer present
@pietbrauer Just noticed I opened this some time ago now. Can it be merged ? Well, going through the changes, I feel that some more tests would be nice... |
@tiennou if you feel you need to add tests I am all for it. Will have a look once they are in |
I'll try to then. I may also have some more minor tweaks I found recently : we needed a |
8c09e8b
to
d1d34a1
Compare
(Re-)rebased against master. I wrote tests for the major parts, as I don't think it's worthwhile to test things like accessors. Unless you want me too 😉. I also added a few things from GitX, and I'll make another PR with the proposed hashing changes. |
Looks good to me but could you fix the indentation in From 36be9eef09a7d659061d07134472ad965c5d273e Mon Sep 17 00:00:00 2001
From: Piet Brauer <piet@nerdishbynature.com>
Date: Wed, 28 Jun 2017 22:11:50 +0200
Subject: [PATCH] Fix indentation
---
ObjectiveGit/GTRepository.m | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ObjectiveGit/GTRepository.m b/ObjectiveGit/GTRepository.m
index cf181a0..e455da7 100644
--- a/ObjectiveGit/GTRepository.m
+++ b/ObjectiveGit/GTRepository.m
@@ -325,7 +325,7 @@ struct GTRemoteCreatePayload {
return nil;
}
- return [GTObject objectWithObj:obj inRepository:self];
+ return [GTObject objectWithObj:obj inRepository:self];
}
- (id)lookUpObjectByGitOid:(const git_oid *)oid error:(NSError **)error {
@@ -402,8 +402,8 @@ typedef void (^GTRepositoryBranchEnumerationBlock)(GTBranch *branch, BOOL *stop)
git_reference *gitRef = NULL;
int gitError = git_branch_iterator_new(&iter, self.git_repository, (git_branch_t)type);
if (gitError != GIT_OK) {
- if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
- return NO;
+ if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
+ return NO;
}
git_branch_t branchType;
@@ -416,11 +416,11 @@ typedef void (^GTRepositoryBranchEnumerationBlock)(GTBranch *branch, BOOL *stop)
}
if (gitError != GIT_OK && gitError != GIT_ITEROVER) {
- if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
- return NO;
+ if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
+ return NO;
}
- return YES;
+ return YES;
}
- (NSArray *)localBranchesWithError:(NSError **)error {
--
2.12.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As stated above:
From 36be9eef09a7d659061d07134472ad965c5d273e Mon Sep 17 00:00:00 2001
From: Piet Brauer <piet@nerdishbynature.com>
Date: Wed, 28 Jun 2017 22:11:50 +0200
Subject: [PATCH] Fix indentation
---
ObjectiveGit/GTRepository.m | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ObjectiveGit/GTRepository.m b/ObjectiveGit/GTRepository.m
index cf181a0..e455da7 100644
--- a/ObjectiveGit/GTRepository.m
+++ b/ObjectiveGit/GTRepository.m
@@ -325,7 +325,7 @@ struct GTRemoteCreatePayload {
return nil;
}
- return [GTObject objectWithObj:obj inRepository:self];
+ return [GTObject objectWithObj:obj inRepository:self];
}
- (id)lookUpObjectByGitOid:(const git_oid *)oid error:(NSError **)error {
@@ -402,8 +402,8 @@ typedef void (^GTRepositoryBranchEnumerationBlock)(GTBranch *branch, BOOL *stop)
git_reference *gitRef = NULL;
int gitError = git_branch_iterator_new(&iter, self.git_repository, (git_branch_t)type);
if (gitError != GIT_OK) {
- if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
- return NO;
+ if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
+ return NO;
}
git_branch_t branchType;
@@ -416,11 +416,11 @@ typedef void (^GTRepositoryBranchEnumerationBlock)(GTBranch *branch, BOOL *stop)
}
if (gitError != GIT_OK && gitError != GIT_ITEROVER) {
- if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
- return NO;
+ if (error) *error = [NSError git_errorFor:gitError description:@"Branch enumeration failed"];
+ return NO;
}
- return YES;
+ return YES;
}
- (NSArray *)localBranchesWithError:(NSError **)error {
--
2.12.2
Made the requested indentation fixups, and rebased ! |
This is a collection of "old" tweaks I have lying around (extracted from #297 actually).
Most of them should be independent, but there are some "breaking" API changes in c31df0c & 80dac00 which change what's returned as a name — e.g. old
refs/heads/master
/refs/heads/origin/master
(the underlying reference name) vs newmaster
/origin/master
).