Skip to content

Commit 24af2cc

Browse files
committed
Set the SBApplication instance's sendMode to kAENoReply to speed up how quickly gitx terminates
Without this it was waiting for the Apple Event to respond, which could result in the gitx command line app staying open for a few seconds as it waits for the reply. This happened frequently when trying to open a repository that was already open.
1 parent 1c430c9 commit 24af2cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Classes/gitx.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ void handleSTDINDiff()
101101

102102
if (diff && [diff length] > 0) {
103103
GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier];
104+
[gitXApp setSendMode:kAENoReply];
104105
[gitXApp activate];
105106
[gitXApp showDiff:diff];
106107
exit(0);
@@ -110,6 +111,7 @@ void handleSTDINDiff()
110111
void handleDiffWithArguments(NSURL *repositoryURL, NSArray *arguments)
111112
{
112113
GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier];
114+
[gitXApp setSendMode:kAENoReply];
113115
[gitXApp activate];
114116
[gitXApp performDiffIn:repositoryURL withOptions:arguments];
115117
exit(0);
@@ -118,6 +120,7 @@ void handleDiffWithArguments(NSURL *repositoryURL, NSArray *arguments)
118120
void handleOpenRepository(NSURL *repositoryURL, NSArray *arguments)
119121
{
120122
GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier];
123+
[gitXApp setSendMode:kAENoReply];
121124
[gitXApp activate];
122125
[gitXApp open:repositoryURL withOptions:arguments];
123126
return;

0 commit comments

Comments
 (0)