This repository was archived by the owner on Jan 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathtag.hpp
More file actions
63 lines (46 loc) · 1.25 KB
/
Copy pathtag.hpp
File metadata and controls
63 lines (46 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include <cppgit2/libgit2_api.hpp>
#include <cppgit2/object.hpp>
#include <cppgit2/oid.hpp>
#include <cppgit2/ownership.hpp>
#include <cppgit2/signature.hpp>
#include <git2.h>
namespace cppgit2 {
class tag : public libgit2_api {
public:
// Default construct a tag
tag();
// Construct from libgit2 C ptr
// If owned by user, this will be free'd in destructor
tag(git_tag *c_ptr, ownership owner = ownership::libgit2);
// Cleanup tag ptr
~tag();
// Create an in-memory copy of a tag
tag copy() const;
// Id of the tag
oid id() const;
// Tag mesage
std::string message() const;
// Tag name
std::string name() const;
// Recursively peel until a non-tag git_object is found
object peel() const;
// Get tagger (author) of this tag
signature tagger() const;
// Get the tagged object of this tag
object target() const;
// Get the OID of the tagged object
oid target_id() const;
// Get the type of a tag's tagged object
object::object_type target_type() const;
// Owner repository for this tag
class repository owner() const;
// Access to libgit2 C ptr
git_tag *c_ptr();
const git_tag *c_ptr() const;
private:
friend class repository;
git_tag *c_ptr_;
ownership owner_;
};
} // namespace cppgit2