@@ -229,11 +229,20 @@ revListLoop:
229
229
break revListLoop
230
230
}
231
231
commitID = commitID [7 :]
232
+ delete (parentsRemaining , commitID )
233
+
232
234
if lastCommitID == commitID {
233
- // skip this
234
- if ! scan .Scan () {
235
- break revListLoop
235
+ // need to skip this commit but just add the parents
236
+ nextParents = strings .Split (scan .Text (), " " )
237
+ if len (nextParents [0 ]) > 40 {
238
+ nextParents [0 ] = nextParents [0 ][40 :]
239
+ } else {
240
+ nextParents = nil
241
+ }
242
+ for _ , parent := range nextParents {
243
+ parentsRemaining [parent ] = true
236
244
}
245
+
237
246
if ! scan .Scan () {
238
247
break revListLoop
239
248
}
@@ -242,10 +251,8 @@ revListLoop:
242
251
break revListLoop
243
252
}
244
253
commitID = commitID [7 :]
254
+ delete (parentsRemaining , commitID )
245
255
}
246
- lastCommitID = commitID
247
- delete (parentsRemaining , commitID )
248
-
249
256
rootTreeID := scan .Text ()
250
257
nextParents = strings .Split (rootTreeID , " " )
251
258
rootTreeID = nextParents [0 ][:40 ]
@@ -254,6 +261,7 @@ revListLoop:
254
261
} else {
255
262
nextParents = nil
256
263
}
264
+ lastCommitID = commitID
257
265
258
266
// push the tree to the cat-file --batch process
259
267
_ , err := batchStdinWriter .Write ([]byte (rootTreeID + "\n " ))
@@ -435,14 +443,18 @@ revListLoop:
435
443
436
444
scan , close = revlister (nioBuffer , commitID , commit .repo .Path , revlistPaths ... )
437
445
defer close ()
446
+ nextParents = nextParents [:0 ]
438
447
if needToFind > 70 {
439
448
nextRevList = 70
440
449
} else {
441
450
nextRevList = needToFind - 1
442
451
}
443
452
}
444
453
445
- for _ , parent := range nextParents {
454
+ for i , parent := range nextParents {
455
+ if parentsRemaining [parent ] {
456
+ nextParents [i ] = ""
457
+ }
446
458
parentsRemaining [parent ] = true
447
459
}
448
460
} else {
0 commit comments