Browse files

close conflict view controller if youve merged everything.

  • Loading branch information...
1 parent dff65ff commit e0e308dbaa221511c3b9df50479da8e37a7e58ea @phronmophobic committed Apr 2, 2012
Showing with 22 additions and 10 deletions.
  1. +22 −10 gimple/ConflictViewController.m
View
32 gimple/ConflictViewController.m
@@ -33,6 +33,22 @@ -(id) initWithGit:(Git*)_git
return nil;
}
+
+-(void) dealloc
+{
+ self.conflicts = nil;
+}
+
+
+- (void) commitAndClose{
+ [git commit:@"merge with conflicts"];
+
+
+ [git sync];
+ [self.view removeFromSuperview];
+ [self release];
+}
+
- (void) refresh{
NSArray* _conflicts = [self.git conflictedFileNames];
NSMutableArray* array = [[[NSMutableArray alloc] init] autorelease];
@@ -45,15 +61,14 @@ - (void) refresh{
[array addObject:dict];
}
-
+
self.conflicts = array;
[conflictView reloadData];
+ if ( [conflicts count] == 0){
+ [self commitAndClose];
+ }
}
--(void) dealloc
-{
- self.conflicts = nil;
-}
+(id) createWithGit:(Git*)_git
{
@@ -139,11 +154,8 @@ -(IBAction)pressedContinue:(id)sender
break;
}
}
- [git commit:@"merge with conflicts"];
-
- [self.view removeFromSuperview];
- [git sync];
- [self release];
+ [self commitAndClose];
}
+
@end

0 comments on commit e0e308d

Please sign in to comment.