summaryrefslogtreecommitdiff
path: root/docs/git2/Index.luadoc
blob: bfa51cc971ef6942c9c207f94ff4143996b9b4c4 (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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
--
-- Warning: AUTOGENERATED DOCS.
--

--- Class "Index".
--
module("Index")

--- Create a new Index object.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_open">git_index_open</a>:<p><p>Since there is no ODB or working directory behind this index,
--  any Index methods which rely on these (e.g. index_add) will
--  fail with the GIT_EBAREINDEX error code.<p> If you need to access the index of an actual repository,
--  use the `git_repository_index` wrapper.<p> The index must be freed once it's no longer in use.
-- @param index_path the path to the index file in disk.  Must be of type <code>string</code>.
-- @return <a href="Index.html">Index</a> or <code>nil</code> on error.
-- @return Error string.
-- @name Index.bare
function Index.bare(index_path)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_clear">git_index_clear</a>:<p><p>
-- @name Index:clear
function Index:clear()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_read">git_index_read</a>:<p><p>
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Index:read
function Index:read()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_write">git_index_write</a>:<p><p>
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Index:write
function Index:write()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_find">git_index_find</a>:<p><p>
-- @param path path to search.  Must be of type <code>string</code>.
-- @return <code>integer</code>.
-- @name Index:find
function Index:find(path)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_uniq">git_index_uniq</a>:<p><p>
-- @name Index:uniq
function Index:uniq()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_add">git_index_add</a>:<p><p>The file `path` must be relative to the repository's
--  working folder and must be readable.<p> This method will fail in bare index instances.<p> This forces the file to be added to the index, not looking
--  at gitignore rules.  Those rules can be evaluated through
--  the git_status APIs (in status.h) before calling this.
-- @param path filename to add.  Must be of type <code>string</code>.
-- @param stage stage for the entry.  Must be of type <code>integer</code>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Index:add
function Index:add(path, stage)
end

--- object method.
--
-- @param source_entry Must be of type <a href="IndexEntry.html">IndexEntry</a>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Index:add2
function Index:add2(source_entry)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_append">git_index_append</a>:<p><p>A new entry will always be inserted into the index;
--  if the index already contains an entry for such
--  path, the old entry will **not** be replaced.<p> The file `path` must be relative to the repository's
--  working folder and must be readable.<p> This method will fail in bare index instances.
-- @param path filename to add.  Must be of type <code>string</code>.
-- @param stage stage for the entry.  Must be of type <code>integer</code>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Index:append
function Index:append(path, stage)
end

--- object method.
--
-- @param source_entry Must be of type <a href="IndexEntry.html">IndexEntry</a>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Index:append2
function Index:append2(source_entry)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_remove">git_index_remove</a>:<p><p>
-- @param position position of the entry to remove.  Must be of type <code>integer</code>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Index:remove
function Index:remove(position)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_get">git_index_get</a>:<p><p>This entry can be modified, and the changes will be written
--  back to disk on the next write() call.<p> The entry should not be freed by the caller.
-- @param n the position of the entry.  Must be of type <code>integer</code>.
-- @return <a href="IndexEntry.html">IndexEntry</a>.
-- @name Index:get
function Index:get(n)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_entrycount">git_index_entrycount</a>:<p><p>
-- @return <code>integer</code>.
-- @name Index:entrycount
function Index:entrycount()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_entrycount_unmerged">git_index_entrycount_unmerged</a>:<p><p>
-- @return <code>integer</code>.
-- @name Index:entrycount_unmerged
function Index:entrycount_unmerged()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_get_unmerged_bypath">git_index_get_unmerged_bypath</a>:<p><p>The returned entry is read-only and should not be modified
--  of freed by the caller.
-- @param path path to search.  Must be of type <code>string</code>.
-- @return <a href="IndexEntryUnmerged.html">IndexEntryUnmerged</a>.
-- @name Index:get_unmerged_bypath
function Index:get_unmerged_bypath(path)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_get_unmerged_byindex">git_index_get_unmerged_byindex</a>:<p><p>The returned entry is read-only and should not be modified
--  of freed by the caller.
-- @param n the position of the entry.  Must be of type <code>integer</code>.
-- @return <a href="IndexEntryUnmerged.html">IndexEntryUnmerged</a>.
-- @name Index:get_unmerged_byindex
function Index:get_unmerged_byindex(n)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_read_tree">git_index_read_tree</a>:<p><p>The current index contents will be replaced by the specified tree.
-- @param tree tree to read.  Must be of type <a href="Tree.html">Tree</a>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Index:read_tree
function Index:read_tree(tree)
end