-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcommit_wrapper.hpp
More file actions
43 lines (27 loc) · 920 Bytes
/
commit_wrapper.hpp
File metadata and controls
43 lines (27 loc) · 920 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
36
37
38
39
40
41
42
43
#pragma once
#include <string>
#include <git2.h>
#include "../wrapper/tree_wrapper.hpp"
#include "../wrapper/wrapper_base.hpp"
class commit_wrapper;
using commit_list_wrapper = list_wrapper<commit_wrapper>;
class commit_wrapper : public wrapper_base<git_commit>
{
public:
using base_type = wrapper_base<git_commit>;
~commit_wrapper();
commit_wrapper(commit_wrapper&&) noexcept = default;
commit_wrapper& operator=(commit_wrapper&&) noexcept = default;
operator git_object*() const noexcept;
const git_oid& oid() const;
std::string commit_oid_tostr() const;
std::string message() const;
std::string summary() const;
commit_wrapper get_parent(size_t i) const;
commit_list_wrapper get_parents_list() const;
tree_wrapper tree() const;
private:
commit_wrapper(git_commit* commit);
friend class repository_wrapper;
friend class reference_wrapper;
};