6 git_repository* repo =
nullptr;
8 int error = git_repository_open_ext(
10 path.string().c_str(),
23 git_repository_free(repository);
25 git_libgit2_shutdown();
29 return repository !=
nullptr;
33 const char* path = git_repository_workdir(repository);
44 git_reference* head =
nullptr;
46 if (git_repository_head(&head, repository) != 0)
49 const git_oid* target = git_reference_target(head);
51 std::string result = git_oid_tostr_s(target);
53 git_reference_free(head);
GitRepository(const fs::path &path)
std::string head_commit() const