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

Mergehead foreach #707

Merged
merged 1 commit into from
May 11, 2021
Merged

Conversation

extrawurst
Copy link
Contributor

closes #705

note that I did not add a test, since I did not even find one for merge in the first place to base this off. let me know if that's fine. the method is tested in gitui though :)

@extrawurst extrawurst force-pushed the mergehead_foreach branch from 4619405 to 513a8c9 Compare May 10, 2021 07:48
@extrawurst
Copy link
Contributor Author

extrawurst commented May 10, 2021

proof of concept usage of it here: gitui-org/gitui#697

including unitest.

(actually my crate asyncgit is full of unittests that essentially test git2-rs it would be cool if we could add that to the ci somehow)

src/merge.rs Outdated
pub callback: &'a mut MergeheadForeachCb<'a>,
}

pub extern "C" fn mergehead_foreach_cb(oid: *const raw::git_oid, payload: *mut c_void) -> c_int {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these definitions be located in repo.rs since they're only used from there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure I hesitated to do that before because right now nothing like this was in repo.rs but this gives us the added benefit of being able to mark a bunch more stuff non-pub 👍

@extrawurst
Copy link
Contributor Author

@alexcrichton moved stuff over (see comment)

@extrawurst extrawurst force-pushed the mergehead_foreach branch from 1d31e23 to 74da401 Compare May 10, 2021 14:54
@alexcrichton alexcrichton merged commit 2358d2c into rust-lang:master May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bindings for git_repository_mergehead_foreach
2 participants