3535#import " GTReference.h"
3636#import " GTFilterList.h"
3737#import " git2/checkout.h"
38+ #import " git2/repository.h"
3839#import " git2/transport.h"
3940#import " git2/sys/transport.h"
4041
@@ -88,22 +89,62 @@ typedef NS_OPTIONS(NSInteger, GTTransportFlags) {
8889
8990// / An `NSNumber` wrapped `GTTransportFlags`, documented above.
9091// / Default value is `GTTransportFlagsNone`.
91- extern NSString *const GTRepositoryCloneOptionsTransportFlags;
92+ extern NSString * const GTRepositoryCloneOptionsTransportFlags;
9293
9394// / An `NSNumber` wrapped `BOOL`, if YES, create a bare clone.
9495// / Default value is `NO`.
95- extern NSString *const GTRepositoryCloneOptionsBare;
96+ extern NSString * const GTRepositoryCloneOptionsBare;
9697
9798// / An `NSNumber` wrapped `BOOL`, if NO, don't checkout the remote HEAD.
9899// / Default value is `YES`.
99- extern NSString *const GTRepositoryCloneOptionsCheckout;
100+ extern NSString * const GTRepositoryCloneOptionsCheckout;
100101
101102// / A `GTCredentialProvider`, that will be used to authenticate against the
102103// / remote.
103- extern NSString *const GTRepositoryCloneOptionsCredentialProvider;
104+ extern NSString * const GTRepositoryCloneOptionsCredentialProvider;
104105
105106// / A BOOL indicating whether local clones should actually clone, or just link.
106- extern NSString *const GTRepositoryCloneOptionsCloneLocal;
107+ extern NSString * const GTRepositoryCloneOptionsCloneLocal;
108+
109+ // / Initialization flags associated with `GTRepositoryInitOptionsFlags` for
110+ // / +initializeEmptyRepositoryAtFileURL:options:error:.
111+ // /
112+ // / See `git_repository_init_flag_t` for more information.
113+ typedef NS_OPTIONS (NSInteger , GTRepositoryInitFlags) {
114+ GTRepositoryInitBare = GIT_REPOSITORY_INIT_BARE,
115+ GTRepositoryInitWithoutReinitializing = GIT_REPOSITORY_INIT_NO_REINIT,
116+ GTRepositoryInitWithoutDotGit = GIT_REPOSITORY_INIT_NO_DOTGIT_DIR,
117+ GTRepositoryInitCreatingRepositoryDirectory = GIT_REPOSITORY_INIT_MKDIR,
118+ GTRepositoryInitCreatingIntermediateDirectories = GIT_REPOSITORY_INIT_MKPATH,
119+ GTRepositoryInitWithExternalTemplate = GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE,
120+ GTRepositoryInitWithRelativeGitLink = GIT_REPOSITORY_INIT_RELATIVE_GITLINK,
121+ };
122+
123+ // / An `NSNumber` wrapping `GTRepositoryInitFlags` with which to initialize the
124+ // / repository.
125+ extern NSString * const GTRepositoryInitOptionsFlags;
126+
127+ // / An `NSNumber` wrapping a `mode_t` or `git_repository_init_mode_t` to use
128+ // / for the initialized repository.
129+ extern NSString * const GTRepositoryInitOptionsMode;
130+
131+ // / An `NSString` to the working directory that should be used. If this is a
132+ // / relative path, it will be resolved against the repository path.
133+ extern NSString * const GTRepositoryInitOptionsWorkingDirectoryPath;
134+
135+ // / An `NSString` of the Git description to use for the new repository.
136+ extern NSString * const GTRepositoryInitOptionsDescription;
137+
138+ // / A file `NSURL` to the template directory that should be used instead of the
139+ // / defaults, if the `GTRepositoryInitWithExternalTemplate` flag is specified.
140+ extern NSString * const GTRepositoryInitOptionsTemplateURL;
141+
142+ // / An `NSString` of the name to use for the initial `HEAD` reference.
143+ extern NSString * const GTRepositoryInitOptionsInitialHEAD;
144+
145+ // / An `NSString` representing an origin URL to add to the repository after
146+ // / initialization.
147+ extern NSString * const GTRepositoryInitOptionsOriginURLString;
107148
108149@interface GTRepository : NSObject
109150
@@ -127,19 +168,12 @@ extern NSString *const GTRepositoryCloneOptionsCloneLocal;
127168// / Initializes a new repository at the given file URL.
128169// /
129170// / fileURL - The file URL for the new repository. Cannot be nil.
171+ // / options - A dictionary of `GTRepositoryInitOptions…` keys controlling how
172+ // / the repository is initialized, or nil to use the defaults.
130173// / error - The error if one occurs.
131174// /
132175// / Returns the initialized repository, or nil if an error occurred.
133- + (instancetype )initializeEmptyRepositoryAtFileURL : (NSURL *)fileURL error : (NSError **)error ;
134-
135- // / Initializes a new repository at the given file URL.
136- // /
137- // / fileURL - The file URL for the new repository. Cannot be nil.
138- // / error - The error if one occurs.
139- // / bare - Should the repository be created bare?
140- // /
141- // / Returns the initialized repository, or nil if an error occurred.
142- + (instancetype )initializeEmptyRepositoryAtFileURL : (NSURL *)fileURL bare : (BOOL )bare error : (NSError **)error ;
176+ + (instancetype )initializeEmptyRepositoryAtFileURL : (NSURL *)fileURL options : (NSDictionary *)options error : (NSError **)error ;
143177
144178+ (id )repositoryWithURL : (NSURL *)localFileURL error : (NSError **)error ;
145179- (id )initWithURL : (NSURL *)localFileURL error : (NSError **)error ;
0 commit comments