Line data Source code
1 : /*! 2 : * \file esys/repo/git/worktree.h 3 : * \brief Linked worktree list entry (ADR-0041) 4 : * 5 : * \cond 6 : * __legal_b__ 7 : * 8 : * Copyright (c) 2026 Michel Gillet 9 : * Distributed under the MIT License. 10 : * (See accompanying file LICENSE.txt or 11 : * copy at https://opensource.org/licenses/MIT) 12 : * 13 : * __legal_e__ 14 : * \endcond 15 : * 16 : */ 17 : 18 : #pragma once 19 : 20 : #include "esys/repo/esysrepo_defs.h" 21 : 22 : #include <string> 23 : 24 : namespace esys::repo::git 25 : { 26 : 27 : /*! \class Worktree esys/repo/git/worktree.h "esys/repo/git/worktree.h" 28 : * \brief One line from ``git worktree list --porcelain`` (subset) 29 : */ 30 18 : class ESYSREPO_API Worktree 31 : { 32 : public: 33 9 : Worktree() = default; 34 : 35 : void set_path(const std::string &path); 36 : const std::string &get_path() const; 37 : 38 : void set_head(const std::string &head); 39 : const std::string &get_head() const; 40 : 41 : void set_bare(bool bare); 42 : bool get_bare() const; 43 : 44 : void set_detached(bool detached); 45 : bool get_detached() const; 46 : 47 : private: 48 : std::string m_path; 49 : std::string m_head; 50 : bool m_bare = false; 51 : bool m_detached = false; 52 : }; 53 : 54 : } // namespace esys::repo::git