Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 78 lines (65 sloc) 2.923 kb
b0c2468 Josh Abernathy added GTBranch
joshaber authored
1 //
2 // GTBranch.h
3 // ObjectiveGitFramework
4 //
5 // Created by Josh Abernathy on 3/3/11.
eb84d05 Timothy Clem add method to get HEAD from a GTRepository
tclem authored
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy
8 // of this software and associated documentation files (the "Software"), to deal
9 // in the Software without restriction, including without limitation the rights
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 // copies of the Software, and to permit persons to whom the Software is
12 // furnished to do so, subject to the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included in
15 // all copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 // THE SOFTWARE.
b0c2468 Josh Abernathy added GTBranch
joshaber authored
24 //
25
541a541 Dave DeLong Rename methods to be more Cocoa-like.
davedelong authored
26 #import "GTObject.h"
27
53d2f70 Timothy Clem support creating branch from current branch (HEAD) in a repo
tclem authored
28 @class GTCommit;
29 @class GTReference;
b0c2468 Josh Abernathy added GTBranch
joshaber authored
30 @class GTRepository;
31
541a541 Dave DeLong Rename methods to be more Cocoa-like.
davedelong authored
32 typedef enum {
33 GTBranchTypeLocal = 1,
34 GTBranchTypeRemote
d7f5056 Josh Abernathy new style of calling all git_ properties their own type
joshaber authored
35 } GTBranchType;
541a541 Dave DeLong Rename methods to be more Cocoa-like.
davedelong authored
36
37 @interface GTBranch : NSObject <GTObject> {}
b0c2468 Josh Abernathy added GTBranch
joshaber authored
38
39 @property (nonatomic, readonly) NSString *name;
53d2f70 Timothy Clem support creating branch from current branch (HEAD) in a repo
tclem authored
40 @property (nonatomic, readonly) NSString *shortName;
41 @property (nonatomic, readonly) NSString *sha;
08b14ed Josh Abernathy added remoteName property
joshaber authored
42 @property (nonatomic, readonly) NSString *remoteName;
541a541 Dave DeLong Rename methods to be more Cocoa-like.
davedelong authored
43 @property (nonatomic, readonly) GTBranchType branchType;
7fe9dfd Josh Abernathy use dct_weak
joshaber authored
44 @property (nonatomic, readonly, dct_weak) GTRepository *repository;
56fdb16 Josh Abernathy converted to arc and some style tweaks
joshaber authored
45 @property (nonatomic, readonly, strong) GTReference *reference;
46 @property (nonatomic, copy) NSArray *remoteBranches;
53d2f70 Timothy Clem support creating branch from current branch (HEAD) in a repo
tclem authored
47
21b6c8a Josh Abernathy added the ability to get remote branches
joshaber authored
48 + (NSString *)localNamePrefix;
49 + (NSString *)remoteNamePrefix;
9508cb0 Josh Abernathy added a method to create a new branch in the repo
joshaber authored
50
b5f5486 Timothy Clem add docs to public headers for main api
tclem authored
51 // Convenience initializers
52 - (id)initWithName:(NSString *)branchName repository:(GTRepository *)repo error:(NSError **)error;
53d2f70 Timothy Clem support creating branch from current branch (HEAD) in a repo
tclem authored
53 + (id)branchWithName:(NSString *)branchName repository:(GTRepository *)repo error:(NSError **)error;
b5f5486 Timothy Clem add docs to public headers for main api
tclem authored
54
55 - (id)initWithReference:(GTReference *)ref repository:(GTRepository *)repo;
53d2f70 Timothy Clem support creating branch from current branch (HEAD) in a repo
tclem authored
56 + (id)branchWithReference:(GTReference *)ref repository:(GTRepository *)repo;
b5f5486 Timothy Clem add docs to public headers for main api
tclem authored
57
140eee7 Timothy Clem cleanup, remove old code
tclem authored
58 // Get the target commit for this branch
b5f5486 Timothy Clem add docs to public headers for main api
tclem authored
59 //
60 // error(out) - will be filled if an error occurs
61 //
62 // returns a GTCommit object or nil if an error occurred
3efa2f9 Timothy Clem GTBranch returns proper target commit now
tclem authored
63 - (GTCommit *)targetCommitAndReturnError:(NSError **)error;
f36f2a2 Josh Abernathy added method to get the most recent commit in a branch
joshaber authored
64
06d5b5c Timothy Clem add fast method for getting number of commits in a branch
tclem authored
65 // Count all commits in this branch
66 //
67 // error(out) - will be filled if an error occurs
68 //
69 // returns number of commits in the branch or NSNotFound if an error occurred
f3cd000 Josh Abernathy more accurate types and explicit casting
joshaber authored
70 - (NSUInteger)numberOfCommitsWithError:(NSError **)error;
6d7b5a0 Josh Abernathy listAllRemoteBranchesInRepository:error: no longer returns HEAD and mast...
joshaber authored
71
5588d04 Josh Abernathy Changed GTBranch.remoteBranch => GTBranch.remoteBranches
joshaber authored
72 // Find the remote branch for the passed in remote name.
73 //
74 // returns the matched remote branch or nil if no match was found.
ad1a763 Josh Abernathy no d
joshaber authored
75 - (GTBranch *)remoteBranchForRemoteName:(NSString *)remote;
5588d04 Josh Abernathy Changed GTBranch.remoteBranch => GTBranch.remoteBranches
joshaber authored
76
b0c2468 Josh Abernathy added GTBranch
joshaber authored
77 @end
Something went wrong with that request. Please try again.