Skip to content

add bindings for git_branch_name_is_valid #715

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

Merged
merged 1 commit into from
Jun 1, 2021

Conversation

franciscod
Copy link
Contributor

Hello! This is my first PR for Rust code. Feedback is greatly appreciated!

related: #714

@franciscod franciscod force-pushed the branch_name_is_valid branch 3 times, most recently from 75bbdc8 to c3f7460 Compare May 29, 2021 22:28
@franciscod franciscod force-pushed the branch_name_is_valid branch from c3f7460 to ea3949a Compare May 31, 2021 02:56
@alexcrichton
Copy link
Member

Thanks! Is this an API though where the initialization function needs to be called first? If so this function may need to have a call to crate::init?

@franciscod
Copy link
Contributor Author

Hmm I'm new to libgit2 as well. But let me try to answer anyway:

By looking at the function source code, it doesn't look like it needs any initialization:
https://github.com/libgit2/libgit2/blob/508361401fbb5d87118045eaeae3356a729131aa/src/branch.c#L740. After digging down some function calls, I've not seen any mention of an initialization function call being required.
Also I don't see any function in src/branch.rs or the related src/reference.rs which calls crate::init.

I'd say there's no need to call crate::init.

@alexcrichton
Copy link
Member

Ok!

@alexcrichton alexcrichton merged commit 0454efb into rust-lang:master Jun 1, 2021
@franciscod franciscod deleted the branch_name_is_valid branch June 1, 2021 16:38
@extrawurst extrawurst mentioned this pull request Jul 27, 2021
4 tasks
@decathorpe
Copy link

Is this function supposed to be present in libgit2 1.1.0? Because I'm getting linker errors while building the latest libgit2-sys / git2 crates (0.12.21+1.1.0 / 0.13.21) on Fedora (building against system libgit2):

git2-0.13.21/src/branch.rs:36: undefined reference to `git_branch_name_is_valid'
          collect2: error: ld returned 1 exit status

@ehuss
Copy link
Contributor

ehuss commented Aug 15, 2021

No, libgit2-sys now needs latest master. That issue is tracked in #721.

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.

6 participants