(git: &git2::Repository, oid: git2::Oid)
| 736 | } |
| 737 | |
| 738 | fn raw_bytes_of(git: &git2::Repository, oid: git2::Oid) -> Vec<u8> { |
| 739 | let content = object_content_of(git, oid); |
| 740 | let header = format!("commit {}\0", content.len()); |
| 741 | let mut raw = header.into_bytes(); |
| 742 | raw.extend_from_slice(&content); |
| 743 | raw |
| 744 | } |
| 745 | |
| 746 | /// Full object content (headers + message), without the `commit N\0` |
| 747 | /// prefix — the same bytes `git cat-file commit <oid>` prints. |