Skip to content

Commit 4432997

Browse files
committed
[brotherbardGH-15] disappearing history
1 parent 502f218 commit 4432997

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

PBGitRevList.mm

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
102102
std::map<string, NSStringEncoding> encodingMap;
103103
NSThread *currentThread = [NSThread currentThread];
104104

105-
NSString *formatString = @"--pretty=format:%H\01%e\01%aN\01%cN\01%s\01%P\01%at";
105+
NSString *formatString = @"--pretty=format:%H\01%e\01%aN\01%cN\01%P\01%at\01%s";
106106
BOOL showSign = [rev hasLeftRight];
107107

108108
if (showSign)
109-
formatString = [formatString stringByAppendingString:@"\01%m"];
109+
formatString = [@"%m\01" stringByAppendingString:formatString];
110110

111111
NSMutableArray *arguments = [NSMutableArray arrayWithObjects:@"log", @"-z", @"--topo-order", @"--children", formatString, nil];
112112

@@ -129,6 +129,16 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
129129
if ([currentThread isCancelled])
130130
break;
131131

132+
char c;
133+
char sign;
134+
if (showSign)
135+
{
136+
stream >> sign;
137+
stream >> c; // Remove separator
138+
if (sign != '>' && sign != '<' && sign != '^' && sign != '-')
139+
DLog(@"Error loading commits: sign not correct");
140+
}
141+
132142
string sha;
133143
if (!getline(stream, sha, '\1'))
134144
break;
@@ -151,15 +161,15 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
151161
git_oid_mkstr(&oid, sha.c_str());
152162
PBGitCommit *newCommit = [PBGitCommit commitWithRepository:repository andSha:[PBGitSHA shaWithOID:oid]];
153163

164+
if (showSign)
165+
[newCommit setSign: sign];
166+
154167
string author;
155168
getline(stream, author, '\1');
156169

157170
string committer;
158171
getline(stream, committer, '\1');
159172

160-
string subject;
161-
getline(stream, subject, '\1');
162-
163173
string parentString;
164174
getline(stream, parentString, '\1');
165175
if (parentString.size() != 0)
@@ -180,26 +190,14 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
180190
int time;
181191
stream >> time;
182192

193+
string subject;
194+
getline(stream, subject, '\0');
195+
183196
[newCommit setSubject:[NSString stringWithCString:subject.c_str() encoding:encoding]];
184197
[newCommit setAuthor:[NSString stringWithCString:author.c_str() encoding:encoding]];
185198
[newCommit setCommitter:[NSString stringWithCString:committer.c_str() encoding:encoding]];
186199
[newCommit setTimestamp:time];
187200

188-
if (showSign)
189-
{
190-
char c;
191-
stream >> c; // Remove separator
192-
stream >> c;
193-
if (c != '>' && c != '<' && c != '^' && c != '-')
194-
DLog(@"Error loading commits: sign not correct");
195-
[newCommit setSign: c];
196-
}
197-
198-
char c;
199-
stream >> c;
200-
if (c != '\0')
201-
cout << "Error" << endl;
202-
203201
[revisions addObject: newCommit];
204202
if (isGraphing)
205203
[g decorateCommit:newCommit];

0 commit comments

Comments
 (0)