@@ -538,6 +538,11 @@ - (NSString *) workingDirectory
538
538
}
539
539
}
540
540
541
+ - (NSURL *) workingDirectoryURL
542
+ {
543
+ return [NSURL fileURLWithPath: [self workingDirectory ]];
544
+ }
545
+
541
546
#pragma mark Remotes
542
547
543
548
- (NSArray *) remotes
@@ -912,7 +917,7 @@ - (BOOL) deleteRef:(PBGitRef *)ref
912
917
913
918
#pragma mark GitX Scripting
914
919
915
- - (void )handleRevListArguments : (NSArray *)arguments inWorkingDirectory : ( NSURL *) workingDirectory
920
+ - (void )handleRevListArguments : (NSArray *)arguments
916
921
{
917
922
if (![arguments count ])
918
923
return ;
@@ -924,21 +929,21 @@ - (void)handleRevListArguments:(NSArray *)arguments inWorkingDirectory:(NSURL *)
924
929
PBGitRef *refArgument = [self refForName: [arguments lastObject ]];
925
930
if (refArgument) {
926
931
revListSpecifier = [[PBGitRevSpecifier alloc ] initWithRef: refArgument];
927
- revListSpecifier.workingDirectory = workingDirectory ;
932
+ revListSpecifier.workingDirectory = [ self workingDirectoryURL ] ;
928
933
}
929
934
}
930
935
931
936
if (!revListSpecifier) {
932
937
revListSpecifier = [[PBGitRevSpecifier alloc ] initWithParameters: arguments];
933
- revListSpecifier.workingDirectory = workingDirectory ;
938
+ revListSpecifier.workingDirectory = [ self workingDirectoryURL ] ;
934
939
}
935
940
936
941
self.currentBranch = [self addBranch: revListSpecifier];
937
942
[PBGitDefaults setShowStageView: NO ];
938
943
[self .windowController showHistoryView: self ];
939
944
}
940
945
941
- - (void )handleBranchFilterEventForFilter : (PBGitXBranchFilterType)filter additionalArguments : (NSMutableArray *)arguments inWorkingDirectory : ( NSURL *) workingDirectory
946
+ - (void )handleBranchFilterEventForFilter : (PBGitXBranchFilterType)filter additionalArguments : (NSMutableArray *)arguments
942
947
{
943
948
self.currentBranchFilter = filter;
944
949
[PBGitDefaults setShowStageView: NO ];
@@ -947,11 +952,11 @@ - (void)handleBranchFilterEventForFilter:(PBGitXBranchFilterType)filter addition
947
952
// treat any additional arguments as a rev-list specifier
948
953
if ([arguments count ] > 1 ) {
949
954
[arguments removeObjectAtIndex: 0 ];
950
- [self handleRevListArguments: arguments inWorkingDirectory: workingDirectory ];
955
+ [self handleRevListArguments: arguments];
951
956
}
952
957
}
953
958
954
- - (void )handleGitXScriptingArguments : (NSAppleEventDescriptor *)argumentsList inWorkingDirectory : ( NSURL *) workingDirectory
959
+ - (void )handleGitXScriptingArguments : (NSAppleEventDescriptor *)argumentsList
955
960
{
956
961
NSMutableArray *arguments = [NSMutableArray array ];
957
962
uint argumentsIndex = 1 ; // AppleEvent list descriptor's are one based
@@ -975,22 +980,22 @@ - (void)handleGitXScriptingArguments:(NSAppleEventDescriptor *)argumentsList inW
975
980
}
976
981
977
982
if ([firstArgument isEqualToString: @" --all" ]) {
978
- [self handleBranchFilterEventForFilter: kGitXAllBranchesFilter additionalArguments: arguments inWorkingDirectory: workingDirectory ];
983
+ [self handleBranchFilterEventForFilter: kGitXAllBranchesFilter additionalArguments: arguments];
979
984
return ;
980
985
}
981
986
982
987
if ([firstArgument isEqualToString: @" --local" ]) {
983
- [self handleBranchFilterEventForFilter: kGitXLocalRemoteBranchesFilter additionalArguments: arguments inWorkingDirectory: workingDirectory ];
988
+ [self handleBranchFilterEventForFilter: kGitXLocalRemoteBranchesFilter additionalArguments: arguments];
984
989
return ;
985
990
}
986
991
987
992
if ([firstArgument isEqualToString: @" --branch" ]) {
988
- [self handleBranchFilterEventForFilter: kGitXSelectedBranchFilter additionalArguments: arguments inWorkingDirectory: workingDirectory ];
993
+ [self handleBranchFilterEventForFilter: kGitXSelectedBranchFilter additionalArguments: arguments];
989
994
return ;
990
995
}
991
996
992
997
// if the argument is not a known command then treat it as a rev-list specifier
993
- [self handleRevListArguments: arguments inWorkingDirectory: workingDirectory ];
998
+ [self handleRevListArguments: arguments];
994
999
}
995
1000
996
1001
// see if the current appleEvent has the command line arguments from the gitx cli
@@ -1010,7 +1015,7 @@ - (void)showWindows
1010
1015
NSURL *workingDirectory = [NSURL URLWithString: path];
1011
1016
if ([[GitRepoFinder gitDirForURL: workingDirectory] isEqual: [self fileURL ]]) {
1012
1017
NSAppleEventDescriptor *argumentsList = [eventRecord paramDescriptorForKeyword: kGitXAEKeyArgumentsList ];
1013
- [self handleGitXScriptingArguments: argumentsList inWorkingDirectory: workingDirectory ];
1018
+ [self handleGitXScriptingArguments: argumentsList];
1014
1019
1015
1020
// showWindows may be called more than once during app launch so remove the CLI data after we handle the event
1016
1021
[currentAppleEvent removeDescriptorWithKeyword: keyAEPropData];
0 commit comments