Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor signature extraction to make use of gix's .signature() #973

Open
Shnatsel opened this issue Aug 30, 2023 · 0 comments
Open

Refactor signature extraction to make use of gix's .signature() #973

Shnatsel opened this issue Aug 30, 2023 · 0 comments
Labels
enhancement help wanted rustsec crate Issues relating to the `rustsec` crate

Comments

@Shnatsel
Copy link
Member

Shnatsel commented Aug 30, 2023

gix 0.52 has added native support for extracting signatures in Byron/gitoxide#973

We should refactor this code to make use of the upstream function:

// Note this is inefficient as gix doesn't yet support signature extraction natively.
// TODO: convert this to native methods once https://github.com/Byron/gitoxide/pull/973 ships in a stable release.
let signed_data = {
let mut commit_without_signature = cref.clone();
let pos = commit_without_signature
.extra_headers
.iter()
.position(|eh| eh.0 == "gpgsig")
.unwrap();
commit_without_signature.extra_headers.remove(pos);
let mut signed_data = Vec::new();
use gix::objs::WriteTo;
commit_without_signature.write_to(&mut signed_data)?;
signed_data
};

@Shnatsel Shnatsel added rustsec crate Issues relating to the `rustsec` crate enhancement labels Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted rustsec crate Issues relating to the `rustsec` crate
Projects
None yet
Development

No branches or pull requests

1 participant