Skip to content

add bindings for git_branch_name_is_valid - #715

Merged
alexcrichton merged 1 commit into
rust-lang:masterfrom
franciscod:branch_name_is_valid
Jun 1, 2021
Merged

alexcrichton merged 1 commit into
rust-lang:masterfrom
franciscod:branch_name_is_valid

Conversation

@franciscod

Copy link
Copy Markdown
Contributor

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

related: #714

Comment thread src/branch.rs Resolved
Comment thread src/branch.rs Resolved
Comment thread src/branch.rs Resolved
@franciscod
franciscod force-pushed the branch_name_is_valid branch 3 times, most recently from 75bbdc8 to c3f7460 Compare May 29, 2021 22:28
Comment thread src/branch.rs Resolved
Comment thread src/branch.rs Resolved
@franciscod
franciscod force-pushed the branch_name_is_valid branch from c3f7460 to ea3949a Compare May 31, 2021 02:56
@alexcrichton

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
1 of 4 tasks
@decathorpe

Copy link
Copy Markdown

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

ehuss commented Aug 15, 2021

Copy link
Copy Markdown
Contributor

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