summaryrefslogtreecommitdiff
path: root/docs/git2/Reference.luadoc
blob: 4c4fae961b18797f172b5095b3b615e52fe93880 (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
--
-- Warning: AUTOGENERATED DOCS.
--

--- Class "Reference".
--
module("Reference")

--- Create a new Reference object.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_lookup">git_reference_lookup</a>:<p><p>The generated reference must be freed by the user.
-- @param repo the repository to look up the reference.  Must be of type <a href="Repository.html">Repository</a>.
-- @param name the long name for the reference (e.g. HEAD, ref/heads/master, refs/tags/v0.1.0, ...).  Must be of type <code>string</code>.
-- @return <a href="Reference.html">Reference</a> or <code>nil</code> on error.
-- @return Error string.
-- @name Reference.lookup
function Reference.lookup(repo, name)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_oid">git_reference_oid</a>:<p><p>Only available if the reference is direct (i.e. not symbolic)
-- @return <a href="OID.html">OID</a>.
-- @name Reference:oid
function Reference:oid()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_set_oid">git_reference_set_oid</a>:<p><p>The reference must be a direct reference, otherwise
--  this method will fail.<p> The reference will be automatically updated in
--  memory and on disk.
-- @param oid Must be of type <a href="OID.html">OID</a>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Reference:set_oid
function Reference:set_oid(oid)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_target">git_reference_target</a>:<p><p>Only available if the reference is symbolic
-- @return <code>string</code>.
-- @name Reference:target
function Reference:target()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_set_target">git_reference_set_target</a>:<p><p>The reference must be a symbolic reference, otherwise
--  this method will fail.<p> The reference will be automatically updated in
--  memory and on disk.
-- @param target The new target for the reference.  Must be of type <code>string</code>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Reference:set_target
function Reference:set_target(target)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_type">git_reference_type</a>:<p><p>Either direct (GIT_REF_OID) or symbolic (GIT_REF_SYMBOLIC)
-- @return <code>integer</code>.
-- @name Reference:type
function Reference:type()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_name">git_reference_name</a>:<p><p>
-- @return <code>string</code>.
-- @name Reference:name
function Reference:name()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_resolve">git_reference_resolve</a>:<p><p>Thie method iteratively peels a symbolic reference
--  until it resolves to a direct reference to an OID.<p> The peeled reference is returned in the `resolved_ref`
--  argument, and must be freed manually once it's no longer
--  needed.<p> If a direct reference is passed as an argument,
--  a copy of that reference is returned. This copy must
--  be manually freed too.
-- @return <a href="Reference.html">Reference</a> or <code>nil</code> on error.
-- @return Error string.
-- @name Reference:resolve
function Reference:resolve()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_owner">git_reference_owner</a>:<p><p>
-- @return <a href="Repository.html">Repository</a>.
-- @name Reference:owner
function Reference:owner()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_rename">git_reference_rename</a>:<p><p>This method works for both direct and symbolic references.
--  The new name will be checked for validity and may be
--  modified into a normalized form.<p> The given git_reference will be updated in place.<p> The reference will be immediately renamed in-memory
--  and on disk.<p> If the `force` flag is not enabled, and there's already
--  a reference with the given name, the renaming will fail.<p> IMPORTANT:
--  The user needs to write a proper reflog entry if the
--  reflog is enabled for the repository. We only rename
--  the reflog if it exists.
-- @param new_name The new name for the reference.  Must be of type <code>string</code>.
-- @param force Overwrite an existing reference.  Must be of type <code>boolean</code>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Reference:rename
function Reference:rename(new_name, force)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_delete">git_reference_delete</a>:<p><p>This method works for both direct and symbolic references.<p> The reference will be immediately removed on disk and from
--  memory. The given reference pointer will no longer be valid.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Reference:delete
function Reference:delete()
end

--- module function.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/reference/git_reference_packall">git_reference_packall</a>:<p><p>This method will load into the cache all the loose
--  references on the repository and update the
--  `packed-refs` file with them.<p> Once the `packed-refs` file has been written properly,
--  the loose references will be removed from disk.
-- @param repo Repository where the loose refs will be packed.  Must be of type <a href="Repository.html">Repository</a>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Reference.packall
function Reference.packall(repo)
end

--- module function.
--
-- @param repo Must be of type <a href="Repository.html">Repository</a>.
-- @param list_flags Must be of type <code>integer</code>.
-- @return <a href="StrArray.html">StrArray</a> or <code>nil</code> on error.
-- @return Error string.
-- @name Reference.list
function Reference.list(repo, list_flags)
end