Reputation: 63
I am trying to create a simple User Interface using Qt, c++ and LibGit2 which displays git branches.
I've done research but cant seem to find anything that explains the process of doing this.
I am still new to C++ and git so I'm sorry in advance if you think this is a stupid question. I'm just trying to learn something new.
Upvotes: 3
Views: 652
Reputation: 2897
See the git_branch_iterator
functions. For example:
git_branch_iterator *it;
if (!git_branch_iterator_new(&it, repo, GIT_BRANCH_ALL)) {
git_reference *ref;
git_branch_t type;
while (!git_branch_next(&ref, &type, it)) {
// Do something with 'ref' and 'type'.
git_reference_free(ref);
}
git_branch_iterator_free(it);
}
Upvotes: 4