summaryrefslogtreecommitdiff
path: root/docs/git2/Repository.luadoc
blob: 5273e7d2f06cdea6c225d1f2907a979464927480 (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
175
176
177
178
--
-- Warning: AUTOGENERATED DOCS.
--

--- Class "Repository".
--
module("Repository")

--- Create a new Repository object.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_open">git_repository_open</a>:<p><p>The 'path' argument must point to either a git repository
--  folder, or an existing work dir.<p> The method will automatically detect if 'path' is a normal
--  or bare repository or fail is 'path' is neither.
-- @param path the path to the repository.  Must be of type <code>string</code>.
-- @return <a href="Repository.html">Repository</a> or <code>nil</code> on error.
-- @return Error string.
-- @name Repository.open
function Repository.open(path)
end

--- Create a new Repository object.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_init">git_repository_init</a>:<p><p>TODO:
-- 	- Reinit the repository
-- @param path the path to the repository.  Must be of type <code>string</code>.
-- @param is_bare if true, a Git repository without a working directory is created   at the pointed path. If false, provided path will be considered as the working   directory into which the .git directory will be created..  Must be of type <code>integer</code>.
-- @return <a href="Repository.html">Repository</a> or <code>nil</code> on error.
-- @return Error string.
-- @name Repository.init
function Repository.init(path, is_bare)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_head">git_repository_head</a>:<p><p>
-- @return <a href="Reference.html">Reference</a> or <code>nil</code> on error.
-- @return Error string.
-- @name Repository:head
function Repository:head()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_head_detached">git_repository_head_detached</a>:<p><p>A repository's HEAD is detached when it points directly to a commit
--  instead of a branch.
-- @return <code>boolean</code>.
-- @name Repository:head_detached
function Repository:head_detached()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_head_orphan">git_repository_head_orphan</a>:<p><p>An orphan branch is one named from HEAD but which doesn't exist in
--  the refs namespace, because it doesn't have any commit to point to.
-- @return <code>boolean</code>.
-- @name Repository:head_orphan
function Repository:head_orphan()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_is_empty">git_repository_is_empty</a>:<p><p>An empty repository has just been initialized and contains
--  no commits.
-- @return <code>boolean</code>.
-- @name Repository:is_empty
function Repository:is_empty()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_is_bare">git_repository_is_bare</a>:<p><p>
-- @return <code>boolean</code>.
-- @name Repository:is_bare
function Repository:is_bare()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_path">git_repository_path</a>:<p><p>This is the path of the `.git` folder for normal repositories,
--  or of the repository itself for bare repositories.
-- @return <code>string</code>.
-- @name Repository:path
function Repository:path()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_workdir">git_repository_workdir</a>:<p><p>If the repository is bare, this function will always return
--  NULL.
-- @return <code>string</code>.
-- @name Repository:workdir
function Repository:workdir()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_set_workdir">git_repository_set_workdir</a>:<p><p>The working directory doesn't need to be the same one
--  that contains the `.git` folder for this repository.<p> If this repository is bare, setting its working directory
--  will turn it into a normal repository, capable of performing
--  all the common workdir operations (checkout, status, index
--  manipulation, etc).
-- @param workdir The path to a working directory.  Must be of type <code>string</code>.
-- @param update_gitlink Must be of type <code>integer</code>.
-- @return <code>true</code> if no error.
-- @return Error string.
-- @name Repository:set_workdir
function Repository:set_workdir(workdir, update_gitlink)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_config">git_repository_config</a>:<p><p>If a configuration file has not been set, the default
--  config set for the repository will be returned, including
--  global and system configurations (if they are available).<p> The configuration file must be freed once it's no longer
--  being used by the user.
-- @return <a href="Config.html">Config</a> or <code>nil</code> on error.
-- @return Error string.
-- @name Repository:config
function Repository:config()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_set_config">git_repository_set_config</a>:<p><p>This configuration file will be used for all configuration
--  queries involving this repository.<p> The repository will keep a reference to the config file;
--  the user must still free the config after setting it
--  to the repository, or it will leak.
-- @param config A Config object.  Must be of type <a href="Config.html">Config</a>.
-- @name Repository:set_config
function Repository:set_config(config)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_odb">git_repository_odb</a>:<p><p>If a custom ODB has not been set, the default
--  database for the repository will be returned (the one
--  located in `.git/objects`).<p> The ODB must be freed once it's no longer being used by
--  the user.
-- @return <a href="ODB.html">ODB</a> or <code>nil</code> on error.
-- @return Error string.
-- @name Repository:odb
function Repository:odb()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_set_odb">git_repository_set_odb</a>:<p><p>The ODB will be used for all object-related operations
--  involving this repository.<p> The repository will keep a reference to the ODB; the user
--  must still free the ODB object after setting it to the
--  repository, or it will leak.
-- @param odb An ODB object.  Must be of type <a href="ODB.html">ODB</a>.
-- @name Repository:set_odb
function Repository:set_odb(odb)
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_index">git_repository_index</a>:<p><p>If a custom index has not been set, the default
--  index for the repository will be returned (the one
--  located in `.git/index`).<p> The index must be freed once it's no longer being used by
--  the user.
-- @return <a href="Index.html">Index</a> or <code>nil</code> on error.
-- @return Error string.
-- @name Repository:index
function Repository:index()
end

--- object method.
--
-- <p>Calls <a href="http://libgit2.github.com/libgit2/#HEAD/group/repository/git_repository_set_index">git_repository_set_index</a>:<p><p>This index will be used for all index-related operations
--  involving this repository.<p> The repository will keep a reference to the index file;
--  the user must still free the index after setting it
--  to the repository, or it will leak.
-- @param index An index object.  Must be of type <a href="Index.html">Index</a>.
-- @name Repository:set_index
function Repository:set_index(index)
end