Parse a post-rewrite event's ` ` full-OID pair (review D3). The RFC §5.4 operation-linkage tier binds a captured post-rewrite event to the operation that performed the rewrite, so the event bytes must name exactly two full-length OIDs separated by whitespace — the Git post-rewrite wire format. `None` means the bytes cannot describe a rewrite pair at all.
(bytes: &[u8])
| 628 | /// post-rewrite wire format. `None` means the bytes cannot describe a |
| 629 | /// rewrite pair at all. |
| 630 | pub fn parse_post_rewrite_pair(bytes: &[u8]) -> Option<(GitObjectId, GitObjectId)> { |
| 631 | let text = std::str::from_utf8(bytes).ok()?; |
| 632 | let mut tokens = text.split_whitespace(); |
| 633 | let old = tokens.next()?; |
| 634 | let new = tokens.next()?; |
| 635 | if tokens.next().is_some() { |
| 636 | return None; |
| 637 | } |
| 638 | Some((parse_git_oid_hex(old)?, parse_git_oid_hex(new)?)) |
| 639 | } |
| 640 | |
| 641 | /// Parse a post-rewrite event's rewrite pairs (review D3). |
| 642 | /// |
nothing calls this directly
no test coverage detected