Skip to content

Commit af83ca9

Browse files
committed
Merge branch 'crash-on-new-repo' of github.com:tiennou/gitx into tiennou-crash-on-new-repo
Conflicts: Classes/git/PBGitGrapher.mm Classes/git/PBGitLane.h
2 parents 02e659d + 27869f9 commit af83ca9

28 files changed

+129
-266
lines changed

Classes/Controllers/PBGitHistoryController.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
@class QLPreviewPanel;
2121
@class PBCommitList;
2222
@class GLFileView;
23-
@class PBGitSHA;
23+
@class GTOID;
2424
@class PBHistorySearchController;
2525

2626
@interface PBGitHistoryController : PBViewController {
@@ -69,7 +69,7 @@
6969
- (IBAction) setTreeView:(id)sender;
7070
- (IBAction) setBranchFilter:(id)sender;
7171

72-
- (void)selectCommit:(PBGitSHA *)commit;
72+
- (void)selectCommit:(GTOID *)commit;
7373
- (IBAction) refresh:(id)sender;
7474
- (IBAction) toggleQLPreviewPanel:(id)sender;
7575
- (IBAction) openSelectedFile:(id)sender;

Classes/Controllers/PBGitHistoryController.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// Copyright 2008 __MyCompanyName__. All rights reserved.
77
//
88

9-
#import "PBGitSHA.h"
109
#import "PBGitCommit.h"
1110
#import "PBGitTree.h"
1211
#import "PBGitRef.h"
@@ -488,7 +487,7 @@ - (void) scrollSelectionToTopOfViewFrom:(NSInteger)oldIndex
488487
commitList.useAdjustScroll = NO;
489488
}
490489

491-
- (NSArray *) selectedObjectsForSHA:(PBGitSHA *)commitSHA
490+
- (NSArray *) selectedObjectsForSHA:(GTOID *)commitSHA
492491
{
493492
NSPredicate *selection = [NSPredicate predicateWithFormat:@"sha == %@", commitSHA];
494493
NSArray *selectedCommits = [[commitController content] filteredArrayUsingPredicate:selection];
@@ -499,7 +498,7 @@ - (NSArray *) selectedObjectsForSHA:(PBGitSHA *)commitSHA
499498
return selectedCommits;
500499
}
501500

502-
- (void)selectCommit:(PBGitSHA *)commitSHA
501+
- (void)selectCommit:(GTOID *)commitSHA
503502
{
504503
if (!forceSelectionUpdate && [[[[commitController selectedObjects] lastObject] sha] isEqual:commitSHA])
505504
return;

Classes/Controllers/PBHistorySearchController.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#import "PBEasyPipe.h"
1717
#import "PBGitBinary.h"
1818
#import "PBGitCommit.h"
19-
#import "PBGitSHA.h"
2019

2120
@interface PBHistorySearchController ()
2221

@@ -448,7 +447,7 @@ - (void)parseBackgroundSearchResults:(NSNotification *)notification
448447
for (NSString *resultSHA in resultsArray) {
449448
NSUInteger index = 0;
450449
for (PBGitCommit *commit in [commitController arrangedObjects]) {
451-
if ([resultSHA isEqualToString:commit.sha.string]) {
450+
if ([resultSHA isEqualToString:commit.sha.SHA]) {
452451
[indexes addIndex:index];
453452
break;
454453
}

Classes/Controllers/PBRepositoryDocumentController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ - (id)makeUntitledDocumentOfType:(NSString *)typeName error:(NSError *__autorele
3434
[op setAllowsMultipleSelection:NO];
3535
[op setMessage:@"Initialize a repository here:"];
3636
[op setTitle:@"New Repository"];
37-
if ([op runModal] != NSFileHandlingPanelOKButton)
37+
if ([op runModal] != NSFileHandlingPanelOKButton) {
38+
*outError = [NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil];
3839
return nil;
40+
}
3941

4042
BOOL success = [GTRepository initializeEmptyRepositoryAtFileURL:[op URL] error:outError];
4143
if (!success)

Classes/Controllers/PBWebHistoryController.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
#import "PBRefContextDelegate.h"
1515

1616

17-
@class PBGitSHA;
17+
@class GTOID;
1818

1919

2020
@interface PBWebHistoryController : PBWebController {
2121
IBOutlet PBGitHistoryController* historyController;
2222
IBOutlet id<PBRefContextDelegate> contextMenuDelegate;
2323

24-
PBGitSHA* currentSha;
24+
GTOID* currentSha;
2525
NSString* diff;
2626
}
2727

Classes/Controllers/PBWebHistoryController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#import "PBWebHistoryController.h"
1010
#import "PBGitDefaults.h"
11-
#import "PBGitSHA.h"
11+
#import <ObjectiveGit/GTConfiguration.h>
1212
#import "PBGitRef.h"
1313
#import "PBGitRevSpecifier.h"
1414

@@ -71,7 +71,7 @@ - (void) changeContentTo: (PBGitCommit *) content
7171
// but this caused some funny behaviour because NSTask's and NSThread's don't really
7272
// like each other. Instead, just do it async.
7373

74-
NSMutableArray *taskArguments = [NSMutableArray arrayWithObjects:@"show", @"--pretty=raw", @"-M", @"--no-color", [currentSha string], nil];
74+
NSMutableArray *taskArguments = [NSMutableArray arrayWithObjects:@"show", @"--pretty=raw", @"-M", @"--no-color", [currentSha SHA], nil];
7575
if (![PBGitDefaults showWhitespaceDifferences])
7676
[taskArguments insertObject:@"-w" atIndex:1];
7777

@@ -103,7 +103,7 @@ - (void)commitDetailsLoaded:(NSNotification *)notification
103103

104104
- (void)selectCommit:(NSString *)sha
105105
{
106-
[historyController selectCommit:[PBGitSHA shaWithString:sha]];
106+
[historyController selectCommit: [GTOID oidWithSHA: sha]];
107107
}
108108

109109
- (void) sendKey: (NSString*) key

Classes/Util/PBEasyPipe.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ + (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSSt
2121
NSTask* task = [[NSTask alloc] init];
2222
[task setLaunchPath:cmd];
2323
[task setArguments:args];
24+
25+
// Prepare ourselves a nicer environment
26+
NSMutableDictionary *env = [[[NSProcessInfo processInfo] environment] mutableCopy];
27+
[env removeObjectsForKeys:@[@"MallocStackLogging", @"MallocStackLoggingNoCompact", @"NSZombieEnabled"]];
28+
[task setEnvironment:env];
29+
2430
if (dir)
2531
[task setCurrentDirectoryPath:dir];
2632

Classes/Views/GLFileView.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#import "GLFileView.h"
1212
#import "PBGitTree.h"
13-
#import "PBGitSHA.h"
1413
#import "PBGitCommit.h"
1514
#import "PBGitHistoryController.h"
1615

@@ -110,7 +109,7 @@ - (void) showFile
110109

111110
- (void) selectCommit:(NSString*)c
112111
{
113-
[historyController selectCommit:[PBGitSHA shaWithString:c]];
112+
[historyController selectCommit: [GTOID oidWithSHA: c]];
114113
}
115114

116115
#pragma mark MGScopeBarDelegate methods

Classes/Views/PBCommitMessageView.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ - (void)drawRect:(NSRect)aRect
5959
NSRectFill(line);
6060

6161
// and one for the body of the commit message
62-
lineWidth = lineWidth = characterWidth * [PBGitDefaults commitMessageViewVerticalBodyLineLength];
62+
lineWidth = characterWidth * [PBGitDefaults commitMessageViewVerticalBodyLineLength];
6363
[[NSColor darkGrayColor] set];
6464
padding = [[self textContainer] lineFragmentPadding];
6565
line.origin.x = padding + lineWidth;

Classes/Views/PBGitRevisionCell.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#import "PBGitRevisionCell.h"
1010
#import "PBGitRef.h"
11-
#import "PBGitSHA.h"
1211
#import "PBGitCommit.h"
1312
#import "PBGitRevSpecifier.h"
1413
#import "RoundedRectangle.h"
@@ -107,10 +106,10 @@ - (void) drawLineFromColumn: (int) from toColumn: (int) to inRect: (NSRect) r of
107106

108107
- (BOOL) isCurrentCommit
109108
{
110-
PBGitSHA *thisSha = [self.objectValue sha];
109+
GTOID *thisSha = [self.objectValue sha];
111110

112111
PBGitRepository* repository = [self.objectValue repository];
113-
PBGitSHA *currentSha = [repository headSHA];
112+
GTOID *currentSha = [repository headSHA];
114113

115114
return [currentSha isEqual:thisSha];
116115
}

0 commit comments

Comments
 (0)