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

0001 /*
0002 SPDX-FileCopyrightText: 2022 Laurent Montel <montel@kde.org>
0003 
0004 SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libkommit_export.h"
0010 
0011 #include <git2/types.h>
0012 
0013 #include <QString>
0014 
0015 namespace Git
0016 {
0017 
0018 class LIBKOMMIT_EXPORT Reference
0019 {
0020 public:
0021     Reference();
0022     Reference(git_reference *ref);
0023     ~Reference();
0024 
0025     Q_REQUIRED_RESULT bool isNote() const;
0026     Q_REQUIRED_RESULT bool isBranch() const;
0027     Q_REQUIRED_RESULT bool isTag() const;
0028     Q_REQUIRED_RESULT bool isRemote() const;
0029     Q_REQUIRED_RESULT QString name() const;
0030     Q_REQUIRED_RESULT QString shorthand() const;
0031 
0032 private:
0033     git_reference *ptr{nullptr};
0034     bool mIsNote{false};
0035     bool mIsBranch{false};
0036     bool mIsTag{false};
0037     bool mIsRemote{false};
0038 
0039     QString mName;
0040     QString mShorthand;
0041 };
0042 
0043 }