@@ -120,7 +120,7 @@ - (GTIndexEntry *)entryWithName:(NSString *)name {
120120
121121- (GTIndexEntry *)entryWithName : (NSString *)name error : (NSError **)error {
122122 size_t pos = 0 ;
123- int gitError = git_index_find (&pos, self.git_index , name.UTF8String );
123+ int gitError = git_index_find (&pos, self.git_index , name.fileSystemRepresentation );
124124 if (gitError != GIT_OK) {
125125 if (error != NULL ) *error = [NSError git_errorFor: gitError description: @" %@ not found in index" , name];
126126 return NULL ;
@@ -139,7 +139,7 @@ - (BOOL)addEntry:(GTIndexEntry *)entry error:(NSError **)error {
139139}
140140
141141- (BOOL )addFile : (NSString *)file error : (NSError **)error {
142- int status = git_index_add_bypath (self.git_index , file.UTF8String );
142+ int status = git_index_add_bypath (self.git_index , file.fileSystemRepresentation );
143143 if (status != GIT_OK) {
144144 if (error != NULL ) *error = [NSError git_errorFor: status description: @" Failed to add file %@ to index." , file];
145145 return NO ;
@@ -148,6 +148,16 @@ - (BOOL)addFile:(NSString *)file error:(NSError **)error {
148148 return YES ;
149149}
150150
151+ - (BOOL )removeFile : (NSString *)file error : (NSError **)error {
152+ int status = git_index_remove_bypath (self.git_index , file.fileSystemRepresentation );
153+ if (status != GIT_OK) {
154+ if (error != NULL ) *error = [NSError git_errorFor: status description: @" Failed to remove file %@ from index." , file];
155+ return NO ;
156+ }
157+
158+ return YES ;
159+ }
160+
151161- (BOOL )write : (NSError **)error {
152162 int status = git_index_write (self.git_index );
153163 if (status != GIT_OK) {
0 commit comments