File indexing completed on 2025-03-09 05:11:41

0001 /*
0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QString>
0010 
0011 #include "interfaces.h"
0012 #include "libkommit_export.h"
0013 
0014 #include "git2/types.h"
0015 
0016 namespace Git
0017 {
0018 
0019 class Tree;
0020 class Note;
0021 
0022 class LIBKOMMIT_EXPORT Branch : public ITree
0023 {
0024 public:
0025     Branch(git_reference *branch);
0026     ~Branch();
0027 
0028     Q_REQUIRED_RESULT QString name() const;
0029     Q_REQUIRED_RESULT QString refName() const;
0030     Q_REQUIRED_RESULT QString upStreamName() const;
0031     Q_REQUIRED_RESULT QString remoteName() const;
0032 
0033     Note *note() const;
0034 
0035     Q_REQUIRED_RESULT bool isHead() const;
0036 
0037     QSharedPointer<Tree> tree() const override;
0038 
0039 private:
0040     git_reference *mBranch;
0041     QString mName;
0042     QString mRefName;
0043     QString mUpStreamName;
0044     QString mRemoteName;
0045     bool mIsHead{false};
0046 };
0047 
0048 }