-- -- Warning: AUTOGENERATED DOCS. -- --- Class "Repository". -- module("Repository") --- Create a new Repository object. -- --

Calls git_repository_open:

The 'path' argument must point to either a git repository -- folder, or an existing work dir.

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 string. -- @return Repository or nil on error. -- @return Error string. -- @name Repository.open function Repository.open(path) end --- Create a new Repository object. -- --

Calls git_repository_init:

TODO: -- - Reinit the repository -- @param path the path to the repository. Must be of type string. -- @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 integer. -- @return Repository or nil on error. -- @return Error string. -- @name Repository.init function Repository.init(path, is_bare) end --- object method. -- --

Calls git_repository_head:

-- @return Reference or nil on error. -- @return Error string. -- @name Repository:head function Repository:head() end --- object method. -- --

Calls git_repository_head_detached:

A repository's HEAD is detached when it points directly to a commit -- instead of a branch. -- @return boolean. -- @name Repository:head_detached function Repository:head_detached() end --- object method. -- --

Calls git_repository_head_orphan:

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 boolean. -- @name Repository:head_orphan function Repository:head_orphan() end --- object method. -- --

Calls git_repository_is_empty:

An empty repository has just been initialized and contains -- no commits. -- @return boolean. -- @name Repository:is_empty function Repository:is_empty() end --- object method. -- --

Calls git_repository_is_bare:

-- @return boolean. -- @name Repository:is_bare function Repository:is_bare() end --- object method. -- --

Calls git_repository_path:

This is the path of the `.git` folder for normal repositories, -- or of the repository itself for bare repositories. -- @return string. -- @name Repository:path function Repository:path() end --- object method. -- --

Calls git_repository_workdir:

If the repository is bare, this function will always return -- NULL. -- @return string. -- @name Repository:workdir function Repository:workdir() end --- object method. -- --

Calls git_repository_set_workdir:

The working directory doesn't need to be the same one -- that contains the `.git` folder for this repository.

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 string. -- @return true if no error. -- @return Error string. -- @name Repository:set_workdir function Repository:set_workdir(workdir) end --- object method. -- --

Calls git_repository_config:

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).

The configuration file must be freed once it's no longer -- being used by the user. -- @return Config or nil on error. -- @return Error string. -- @name Repository:config function Repository:config() end --- object method. -- --

Calls git_repository_set_config:

This configuration file will be used for all configuration -- queries involving this repository.

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 Config. -- @name Repository:set_config function Repository:set_config(config) end --- object method. -- --

Calls git_repository_odb:

If a custom ODB has not been set, the default -- database for the repository will be returned (the one -- located in `.git/objects`).

The ODB must be freed once it's no longer being used by -- the user. -- @return ODB or nil on error. -- @return Error string. -- @name Repository:odb function Repository:odb() end --- object method. -- --

Calls git_repository_set_odb:

The ODB will be used for all object-related operations -- involving this repository.

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 ODB. -- @name Repository:set_odb function Repository:set_odb(odb) end --- object method. -- --

Calls git_repository_index:

If a custom index has not been set, the default -- index for the repository will be returned (the one -- located in `.git/index`).

The index must be freed once it's no longer being used by -- the user. -- @return Index or nil on error. -- @return Error string. -- @name Repository:index function Repository:index() end --- object method. -- --

Calls git_repository_set_index:

This index will be used for all index-related operations -- involving this repository.

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 Index. -- @name Repository:set_index function Repository:set_index(index) end