@@ -102,11 +102,11 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
102
102
std::map<string, NSStringEncoding > encodingMap;
103
103
NSThread *currentThread = [NSThread currentThread ];
104
104
105
- NSString *formatString = @" --pretty=format:%H\01 %e \01 %a N\01 %c N\01 %s \01 %P \01 %a t " ;
105
+ NSString *formatString = @" --pretty=format:%H\01 %e \01 %a N\01 %c N\01 %P \01 %a t \01 %s " ;
106
106
BOOL showSign = [rev hasLeftRight ];
107
107
108
108
if (showSign)
109
- formatString = [formatString stringByAppendingString: @" \01 %m " ];
109
+ formatString = [@" %m \01 " stringByAppendingString: formatString ];
110
110
111
111
NSMutableArray *arguments = [NSMutableArray arrayWithObjects: @" log" , @" -z" , @" --topo-order" , @" --children" , formatString, nil ];
112
112
@@ -129,6 +129,16 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
129
129
if ([currentThread isCancelled ])
130
130
break ;
131
131
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
+
132
142
string sha;
133
143
if (!getline (stream, sha, ' \1 ' ))
134
144
break ;
@@ -151,15 +161,15 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
151
161
git_oid_mkstr (&oid, sha.c_str ());
152
162
PBGitCommit *newCommit = [PBGitCommit commitWithRepository: repository andSha: [PBGitSHA shaWithOID: oid]];
153
163
164
+ if (showSign)
165
+ [newCommit setSign: sign];
166
+
154
167
string author;
155
168
getline (stream, author, ' \1 ' );
156
169
157
170
string committer;
158
171
getline (stream, committer, ' \1 ' );
159
172
160
- string subject;
161
- getline (stream, subject, ' \1 ' );
162
-
163
173
string parentString;
164
174
getline (stream, parentString, ' \1 ' );
165
175
if (parentString.size () != 0 )
@@ -180,26 +190,14 @@ - (void) walkRevisionListWithSpecifier:(PBGitRevSpecifier*)rev
180
190
int time;
181
191
stream >> time;
182
192
193
+ string subject;
194
+ getline (stream, subject, ' \0 ' );
195
+
183
196
[newCommit setSubject: [NSString stringWithCString: subject.c_str () encoding: encoding]];
184
197
[newCommit setAuthor: [NSString stringWithCString: author.c_str () encoding: encoding]];
185
198
[newCommit setCommitter: [NSString stringWithCString: committer.c_str () encoding: encoding]];
186
199
[newCommit setTimestamp: time];
187
200
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
-
203
201
[revisions addObject: newCommit];
204
202
if (isGraphing)
205
203
[g decorateCommit: newCommit];
0 commit comments