forked from p-ranav/cppgit2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathannotated_commit.hpp
More file actions
35 lines (26 loc) · 839 Bytes
/
Copy pathannotated_commit.hpp
File metadata and controls
35 lines (26 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <git2.h>
#include <cppgit2/libgit2_api.hpp>
#include <cppgit2/oid.hpp>
#include <cppgit2/ownership.hpp>
namespace cppgit2 {
class annotated_commit : public libgit2_api {
public:
// Default construct annotated commit
annotated_commit();
// Construct from libgit2 C ptr
// If owned by user, will be free'd in the destructor
annotated_commit(git_annotated_commit* c_ptr,
ownership owner = ownership::libgit2);
// Cleanup
~annotated_commit();
// Gets the commit ID that the given git_annotated_commit refers to.
oid id() const;
// Get the refname that the given git_annotated_commit refers to.
std::string refname() const;
const git_annotated_commit* c_ptr() const;
private:
friend class repository;
git_annotated_commit* c_ptr_;
ownership owner_;
};
} // namespace cppgit2