Skip to content

Commit 14d6a5a

Browse files
committed
Remove branch creation method from GTRepository.
1 parent c544fa6 commit 14d6a5a

File tree

4 files changed

+0
-34
lines changed

4 files changed

+0
-34
lines changed

Classes/GTBranch.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ typedef enum {
4747
@property (nonatomic, assign) GTBranch *trackingBranch;
4848
@property (nonatomic, readonly, getter=isHead) BOOL head;
4949

50-
+ (NSString *)localNamePrefix;
51-
+ (NSString *)remoteNamePrefix;
52-
5350
// Lookup a branch by name. Performs a `GTBranchTypeAny` lookup.
5451
// See `+branchByLookingUpBranchNamed:type:inRepository:error:`.
5552
+ (instancetype)branchByLookingUpBranchNamed:(NSString *)name inRepository:(GTRepository *)repository error:(NSError **)error;

Classes/GTBranch.m

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,6 @@
3232

3333
@implementation GTBranch
3434

35-
#pragma mark -
36-
#pragma mark Class methods
37-
38-
+ (NSString *)localNamePrefix {
39-
return @"refs/heads/";
40-
}
41-
42-
+ (NSString *)remoteNamePrefix {
43-
return @"refs/remotes/";
44-
}
45-
4635
#pragma mark -
4736
#pragma mark Lifecycle
4837

Classes/GTRepository.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,6 @@ extern NSString *const GTRepositoryCloneOptionsCredentialProvider;
216216
// returns number of commits in the current branch or NSNotFound if an error occurred
217217
- (NSUInteger)numberOfCommitsInCurrentBranch:(NSError **)error;
218218

219-
// Create a new branch with this name and based off this reference.
220-
//
221-
// name - the name for the new branch
222-
// ref - the reference to create the new branch off
223-
// error(out) - will be filled if an error occurs
224-
//
225-
// returns the new branch or nil if an error occurred.
226-
- (GTBranch *)createBranchNamed:(NSString *)name fromReference:(GTReference *)ref error:(NSError **)error;
227-
228219
// Get the current branch.
229220
//
230221
// error(out) - will be filled if an error occurs

Classes/GTRepository.m

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -396,17 +396,6 @@ - (NSUInteger)numberOfCommitsInCurrentBranch:(NSError **)error {
396396
return [currentBranch numberOfCommitsWithError:error];
397397
}
398398

399-
- (GTBranch *)createBranchNamed:(NSString *)name fromReference:(GTReference *)ref error:(NSError **)error {
400-
// make sure the ref is up to date before we branch off it, otherwise we could branch off an older sha
401-
ref = [ref reloadedReferenceWithError:error];
402-
if (ref == nil) return nil;
403-
404-
GTReference *newRef = [GTReference referenceByCreatingReferenceNamed:[NSString stringWithFormat:@"%@%@", [GTBranch localNamePrefix], name] fromReferenceTarget:[ref.resolvedTarget SHA] inRepository:self error:error];
405-
if (newRef == nil) return nil;
406-
407-
return [GTBranch branchWithReference:newRef];
408-
}
409-
410399
- (BOOL)isEmpty {
411400
return (BOOL) git_repository_is_empty(self.git_repository);
412401
}

0 commit comments

Comments
 (0)