Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pieter/26509 to your computer and use it in GitHub Desktop.
Save pieter/26509 to your computer and use it in GitHub Desktop.
From 22800c8fd3075a7770cb874ba4545e839ac32720 Mon Sep 17 00:00:00 2001
From: Pieter de Bie <pdebie@ai.rug.nl>
Date: Wed, 19 Nov 2008 14:35:48 +0100
Subject: [PATCH] Revert "Merge branch 'master' of git://github.com/bkerley/gitx"
This reverts commit 66f3588b778fab412ba03435b3c8906ae2802743.
Conflicts:
PBGitRevList.m
---
PBEasyPipe.h | 1 -
PBEasyPipe.m | 2 +-
PBGitCommit.m | 5 +++--
PBGitRevList.m | 5 +----
4 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/PBEasyPipe.h b/PBEasyPipe.h
index 03b80b9..8b15646 100644
--- a/PBEasyPipe.h
+++ b/PBEasyPipe.h
@@ -12,7 +12,6 @@
@interface PBEasyPipe : NSObject {
}
-+ (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir;
+ (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args;
+ (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir: (NSString*) dir;
diff --git a/PBEasyPipe.m b/PBEasyPipe.m
index b18c12e..1fe7f37 100644
--- a/PBEasyPipe.m
+++ b/PBEasyPipe.m
@@ -106,7 +106,7 @@
NSData* data = [handle readDataToEndOfFile];
NSString* string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- [task waitUntilExit];
+
// Strip trailing newline
if ([string hasSuffix:@"\n"])
string = [string substringToIndex:[string length]-1];
diff --git a/PBGitCommit.m b/PBGitCommit.m
index f38bf43..8e9a50d 100644
--- a/PBGitCommit.m
+++ b/PBGitCommit.m
@@ -40,8 +40,9 @@
if (details != nil)
return details;
- details = [self.repository outputForCommand:[@"show --pretty=raw " stringByAppendingString:self.sha]];
-
+ NSFileHandle* handle = [self.repository handleForCommand:[@"show --pretty=raw " stringByAppendingString:self.sha]];
+ details = [[NSString alloc] initWithData:[handle readDataToEndOfFile] encoding: NSUTF8StringEncoding];
+
return details;
}
diff --git a/PBGitRevList.m b/PBGitRevList.m
index b4d37ec..98922e8 100644
--- a/PBGitRevList.m
+++ b/PBGitRevList.m
@@ -82,9 +82,7 @@
if ([rev hasPathLimiter])
[arguments insertObject:@"--children" atIndex:1];
- NSTask *task = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:arguments inDir:[repository fileURL].path];
- [task launch];
- NSFileHandle* handle = [task.standardOutput fileHandleForReading];
+ NSFileHandle* handle = [repository handleForArguments: arguments];
int fd = [handle fileDescriptor];
FILE* f = fdopen(fd, "r");
@@ -149,7 +147,6 @@
// Make sure the commits are stored before exiting.
[self performSelectorOnMainThread:@selector(setCommits:) withObject:revisions waitUntilDone:YES];
- [task waitUntilExit];
}
@end
--
1.6.0.3.875.g5bf73+GitX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment