perf(gpg-agent): reuse buffer for signature
This commit is contained in:
parent
fae0b36248
commit
fae0dae758
|
@ -557,13 +557,13 @@ fn main() -> Result<()> {
|
|||
// NOTE: don't need to handle append here, since we'll never be
|
||||
// both appending *and* signing
|
||||
if let Some(ctx) = &mut gpg {
|
||||
signature_bytes.clear();
|
||||
let to_sign = format!("{header}\n{message}");
|
||||
let mut output = Vec::new();
|
||||
ctx.sign(SignMode::Detached, to_sign, &mut output)
|
||||
ctx.sign(SignMode::Detached, to_sign, &mut signature_bytes)
|
||||
.context("could not sign commit")
|
||||
.unwrap(); // FIXME
|
||||
|
||||
let sig = String::from_utf8(output)
|
||||
let sig = std::str::from_utf8(&signature_bytes)
|
||||
.context("signature was not utf-8")
|
||||
.unwrap(); // FIXME
|
||||
|
||||
|
|
Loading…
Reference in New Issue