startgit

Static page generator for git repositories
git clone git://git.dimitrijedobrota.com/startgit.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING

branch.hpp (945B)


0 #pragma once
2 #include <string>
3 #include <vector>
5 #include <git2wrap/branch.hpp>
7 #include "commit.hpp"
8 #include "file.hpp"
10 namespace startgit
11 {
13 class repository;
15 class branch
16 {
17 public:
18 explicit branch(git2wrap::branch brnch, repository& repo);
19 branch(const branch&) = delete;
20 branch& operator=(const branch&) = delete;
21 branch(branch&&) = default;
22 branch& operator=(branch&&) = default;
23 ~branch() = default;
25 const auto& get() const { return m_branch; }
27 const std::string& get_name() const { return m_name; }
28 const commit& get_last_commit() const { return m_commits[0]; }
30 const auto& get_commits() const { return m_commits; }
31 const auto& get_files() const { return m_files; }
32 const auto& get_special() const { return m_special; }
34 private:
35 git2wrap::branch m_branch;
37 std::string m_name;
39 std::vector<commit> m_commits;
40 std::vector<file> m_files;
41 std::vector<file> m_special;
42 };
44 } // namespace startgit