startgitStatic 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 1 2 #include <string> 3 #include <vector> 4 5 #include <git2wrap/branch.hpp> 6 7 #include "commit.hpp" 8 #include "file.hpp" 9 10 namespace startgit 11 { 12 13 class repository; 14 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; 24 25 const auto& get() const { return m_branch; } 26 27 const std::string& get_name() const { return m_name; } 28 const commit& get_last_commit() const { return m_commits[0]; } 29 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; } 33 34 private: 35 git2wrap::branch m_branch; 36 37 std::string m_name; 38 39 std::vector<commit> m_commits; 40 std::vector<file> m_files; 41 std::vector<file> m_special; 42 }; 43 44 } // namespace startgit