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)


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