From aa43e18d619ee45d926afafcb4cb2935b8810751 Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Thu, 11 Jun 2009 18:50:21 +0100 Subject: [PATCH] PBGitRepository: Add support for changing the environment when executing commands --- PBGitRepository.h | 3 +++ PBGitRepository.m | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/PBGitRepository.h b/PBGitRepository.h index eb61f77..93c38c9 100644 --- a/PBGitRepository.h +++ b/PBGitRepository.h @@ -33,6 +33,9 @@ extern NSString* PBGitRepositoryErrorDomain; - (NSString*) outputForCommand:(NSString*) cmd; - (NSString *)outputForCommand:(NSString *)str retValue:(int *)ret; - (NSString *)outputForArguments:(NSArray *)arguments inputString:(NSString *)input retValue:(int *)ret; +- (NSString *)outputForArguments:(NSArray *)arguments inputString:(NSString *)input byExtendingEnvironment:(NSDictionary *)dict retValue:(int *)ret; + + - (NSString*) outputForArguments:(NSArray*) args; - (NSString*) outputForArguments:(NSArray*) args retValue:(int *)ret; - (NSString *)outputInWorkdirForArguments:(NSArray*) arguments; diff --git a/PBGitRepository.m b/PBGitRepository.m index 15a49bb..89691f9 100644 --- a/PBGitRepository.m +++ b/PBGitRepository.m @@ -384,7 +384,7 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; return [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments inDir: self.fileURL.path retValue: ret]; } -- (NSString*) outputForArguments:(NSArray *)arguments inputString:(NSString *)input retValue:(int *)ret; +- (NSString*) outputForArguments:(NSArray *)arguments inputString:(NSString *)input retValue:(int *)ret { return [PBEasyPipe outputForCommand:[PBGitBinary path] withArgs:arguments @@ -393,6 +393,16 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain"; retValue: ret]; } +- (NSString *)outputForArguments:(NSArray *)arguments inputString:(NSString *)input byExtendingEnvironment:(NSDictionary *)dict retValue:(int *)ret +{ + return [PBEasyPipe outputForCommand:[PBGitBinary path] + withArgs:arguments + inDir:[self workingDirectory] + byExtendingEnvironment:dict + inputString:input + retValue: ret]; +} + - (BOOL)executeHook:(NSString *)name output:(NSString **)output { return [self executeHook:name withArgs:[NSArray array] output:output]; -- 2.11.4.GIT