mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
[GH-15] disappearing history
This commit is contained in:
+18
-20
@@ -102,11 +102,11 @@ using namespace std;
|
||||
std::map<string, NSStringEncoding> encodingMap;
|
||||
NSThread *currentThread = [NSThread currentThread];
|
||||
|
||||
NSString *formatString = @"--pretty=format:%H\01%e\01%aN\01%cN\01%s\01%P\01%at";
|
||||
NSString *formatString = @"--pretty=format:%H\01%e\01%aN\01%cN\01%P\01%at\01%s";
|
||||
BOOL showSign = [rev hasLeftRight];
|
||||
|
||||
if (showSign)
|
||||
formatString = [formatString stringByAppendingString:@"\01%m"];
|
||||
formatString = [@"%m\01" stringByAppendingString:formatString];
|
||||
|
||||
NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--topo-order", @"--children", formatString, nil];
|
||||
|
||||
@@ -129,6 +129,16 @@ using namespace std;
|
||||
if ([currentThread isCancelled])
|
||||
break;
|
||||
|
||||
char c;
|
||||
char sign;
|
||||
if (showSign)
|
||||
{
|
||||
stream >> sign;
|
||||
stream >> c; // Remove separator
|
||||
if (sign != '>' && sign != '<' && sign != '^' && sign != '-')
|
||||
DLog(@"Error loading commits: sign not correct");
|
||||
}
|
||||
|
||||
string sha;
|
||||
if (!getline(stream, sha, '\1'))
|
||||
break;
|
||||
@@ -151,15 +161,15 @@ using namespace std;
|
||||
git_oid_mkstr(&oid, sha.c_str());
|
||||
PBGitCommit *newCommit = [PBGitCommit commitWithRepository:repository andSha:[PBGitSHA shaWithOID:oid]];
|
||||
|
||||
if (showSign)
|
||||
[newCommit setSign: sign];
|
||||
|
||||
string author;
|
||||
getline(stream, author, '\1');
|
||||
|
||||
string committer;
|
||||
getline(stream, committer, '\1');
|
||||
|
||||
string subject;
|
||||
getline(stream, subject, '\1');
|
||||
|
||||
string parentString;
|
||||
getline(stream, parentString, '\1');
|
||||
if (parentString.size() != 0)
|
||||
@@ -180,26 +190,14 @@ using namespace std;
|
||||
int time;
|
||||
stream >> time;
|
||||
|
||||
string subject;
|
||||
getline(stream, subject, '\0');
|
||||
|
||||
[newCommit setSubject:[NSString stringWithCString:subject.c_str() encoding:encoding]];
|
||||
[newCommit setAuthor:[NSString stringWithCString:author.c_str() encoding:encoding]];
|
||||
[newCommit setCommitter:[NSString stringWithCString:committer.c_str() encoding:encoding]];
|
||||
[newCommit setTimestamp:time];
|
||||
|
||||
if (showSign)
|
||||
{
|
||||
char c;
|
||||
stream >> c; // Remove separator
|
||||
stream >> c;
|
||||
if (c != '>' && c != '<' && c != '^' && c != '-')
|
||||
DLog(@"Error loading commits: sign not correct");
|
||||
[newCommit setSign: c];
|
||||
}
|
||||
|
||||
char c;
|
||||
stream >> c;
|
||||
if (c != '\0')
|
||||
cout << "Error" << endl;
|
||||
|
||||
[revisions addObject: newCommit];
|
||||
if (isGraphing)
|
||||
[g decorateCommit:newCommit];
|
||||
|
||||
Reference in New Issue
Block a user