Guest User

Untitled

a guest
Feb 21st, 2018
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. From 879a79bd78549264458a4d4a8f617b7d21a230da Mon Sep 17 00:00:00 2001
  2. From: Pieter de Bie <pdebie@ai.rug.nl>
  3. Date: Wed, 19 Nov 2008 14:40:41 +0100
  4. Subject: [PATCH] Revert "Revert "Merge branch 'master' of git://github.com/bkerley/gitx""
  5.  
  6. This reverts commit 22800c8fd3075a7770cb874ba4545e839ac32720.
  7. ---
  8. PBEasyPipe.h | 1 +
  9. PBEasyPipe.m | 2 +-
  10. PBGitCommit.m | 5 ++---
  11. PBGitRevList.m | 5 ++++-
  12. 4 files changed, 8 insertions(+), 5 deletions(-)
  13.  
  14. diff --git a/PBEasyPipe.h b/PBEasyPipe.h
  15. index 8b15646..03b80b9 100644
  16. --- a/PBEasyPipe.h
  17. +++ b/PBEasyPipe.h
  18. @@ -12,6 +12,7 @@
  19. @interface PBEasyPipe : NSObject {
  20.  
  21. }
  22. ++ (NSTask *) taskForCommand:(NSString *)cmd withArgs:(NSArray *)args inDir:(NSString *)dir;
  23.  
  24. + (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args;
  25. + (NSFileHandle*) handleForCommand: (NSString*) cmd withArgs: (NSArray*) args inDir: (NSString*) dir;
  26. diff --git a/PBEasyPipe.m b/PBEasyPipe.m
  27. index 1fe7f37..b18c12e 100644
  28. --- a/PBEasyPipe.m
  29. +++ b/PBEasyPipe.m
  30. @@ -106,7 +106,7 @@
  31.  
  32. NSData* data = [handle readDataToEndOfFile];
  33. NSString* string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  34. -
  35. + [task waitUntilExit];
  36. // Strip trailing newline
  37. if ([string hasSuffix:@"\n"])
  38. string = [string substringToIndex:[string length]-1];
  39. diff --git a/PBGitCommit.m b/PBGitCommit.m
  40. index 8e9a50d..f38bf43 100644
  41. --- a/PBGitCommit.m
  42. +++ b/PBGitCommit.m
  43. @@ -40,9 +40,8 @@
  44. if (details != nil)
  45. return details;
  46.  
  47. - NSFileHandle* handle = [self.repository handleForCommand:[@"show --pretty=raw " stringByAppendingString:self.sha]];
  48. - details = [[NSString alloc] initWithData:[handle readDataToEndOfFile] encoding: NSUTF8StringEncoding];
  49. -
  50. + details = [self.repository outputForCommand:[@"show --pretty=raw " stringByAppendingString:self.sha]];
  51. +
  52. return details;
  53. }
  54.  
  55. diff --git a/PBGitRevList.m b/PBGitRevList.m
  56. index 98922e8..b4d37ec 100644
  57. --- a/PBGitRevList.m
  58. +++ b/PBGitRevList.m
  59. @@ -82,7 +82,9 @@
  60. if ([rev hasPathLimiter])
  61. [arguments insertObject:@"--children" atIndex:1];
  62.  
  63. - NSFileHandle* handle = [repository handleForArguments: arguments];
  64. + NSTask *task = [PBEasyPipe taskForCommand:[PBGitBinary path] withArgs:arguments inDir:[repository fileURL].path];
  65. + [task launch];
  66. + NSFileHandle* handle = [task.standardOutput fileHandleForReading];
  67.  
  68. int fd = [handle fileDescriptor];
  69. FILE* f = fdopen(fd, "r");
  70. @@ -147,6 +149,7 @@
  71.  
  72. // Make sure the commits are stored before exiting.
  73. [self performSelectorOnMainThread:@selector(setCommits:) withObject:revisions waitUntilDone:YES];
  74. + [task waitUntilExit];
  75. }
  76.  
  77. @end
  78. --
  79. 1.6.0.3.875.g5bf73+GitX
Add Comment
Please, Sign In to add comment