@@ -77,6 +77,7 @@ - (void)dealloc {
7777
7878+ (instancetype )inMemoryIndexWithRepository : (GTRepository *)repository error : (NSError **)error {
7979 git_index *index = NULL ;
80+
8081 int status = git_index_new (&index);
8182 if (status != GIT_OK) {
8283 if (error != NULL ) *error = [NSError git_errorFor: status description: @" Failed to initialize in-memory index" ];
@@ -193,17 +194,6 @@ - (BOOL)addFile:(NSString *)file error:(NSError **)error {
193194 return YES ;
194195}
195196
196- - (BOOL )addContentsOfTree : (GTTree *)tree error : (NSError **)error {
197- NSParameterAssert (tree != nil );
198-
199- int status = git_index_read_tree (self.git_index , tree.git_tree );
200- if (status != GIT_OK) {
201- if (error != NULL ) *error = [NSError git_errorFor: status description: @" Failed to read tree %@ into index." , tree];
202- return NO ;
203- }
204-
205- return YES ;
206- }
207197- (BOOL )addData : (NSData *)data withName : (NSString *)name error : (NSError **)error {
208198 NSParameterAssert (data != nil );
209199 NSParameterAssert (name != nil );
@@ -223,6 +213,18 @@ - (BOOL)addData:(NSData *)data withName:(NSString *)name error:(NSError **)error
223213 return YES ;
224214}
225215
216+ - (BOOL )addContentsOfTree : (GTTree *)tree error : (NSError **)error {
217+ NSParameterAssert (tree != nil );
218+
219+ int status = git_index_read_tree (self.git_index , tree.git_tree );
220+ if (status != GIT_OK) {
221+ if (error != NULL ) *error = [NSError git_errorFor: status description: @" Failed to read tree %@ into index." , tree];
222+ return NO ;
223+ }
224+
225+ return YES ;
226+ }
227+
226228- (BOOL )removeFile : (NSString *)file error : (NSError **)error {
227229 NSString *unicodeString = [self composedUnicodeStringWithString: file];
228230
0 commit comments