(git: &GitRepository, commit: &git2::Commit<'_>, limit: usize)
| 39 | } |
| 40 | |
| 41 | fn input_budget(git: &GitRepository, commit: &git2::Commit<'_>, limit: usize) -> CliResult<()> { |
| 42 | let bytes = input_blob_bytes(git, commit)?; |
| 43 | if bytes > limit { |
| 44 | return Err(git_error(format!("direct stream commit {} needs {bytes} input bytes, above {limit}; increase the explicit bound", commit.id()))); |
| 45 | } |
| 46 | Ok(()) |
| 47 | } |
| 48 | |
| 49 | fn input_blob_bytes(git: &GitRepository, commit: &git2::Commit<'_>) -> CliResult<usize> { |
| 50 | let tree = commit.tree().map_err(|e| git_error(e.to_string()))?; |
no test coverage detected