Commit 2a118d2
committed
filter-repo: don't crash on streams containing gpgsig blocks
In the future we want to preserve commit signatures (see issue #139).
To prepare for that, let's teach the fast-export stream parser to
recognize and skip `gpgsig` header blocks followed by a `data` block
for the signature content. Git >= v2.50.0 can emit such blocks
between `committer` and `encoding`/`data`, using for example:
`git fast-export --signed-commits=verbatim`
Up to two `gpgsig` blocks may appear (one per hash algorithm).
Note that no new flags are passed to `git fast-export`, so signatures
are still stripped in practice. We only prevent an assertion failure in
`_parse_data` if a stream containing `gpgsig` blocks is fed in (e.g. by
hand or by a future version of filter-repo).
Signed-off-by: Christian Couder <christian.couder@gmail.com>1 parent c1d8461 commit 2a118d2
2 files changed
Lines changed: 52 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1311 | 1311 | | |
1312 | 1312 | | |
1313 | 1313 | | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
1314 | 1318 | | |
1315 | 1319 | | |
1316 | 1320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
383 | 431 | | |
384 | 432 | | |
385 | 433 | | |
| |||
0 commit comments