Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
6632c155
Commit
6632c155
authored
Nov 26, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document all of the things
parent
b54b88c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
119 additions
and
1 deletions
+119
-1
include/git2/repository.h
+119
-1
No files found.
include/git2/repository.h
View file @
6632c155
...
...
@@ -88,7 +88,6 @@ GIT_EXTERN(void) git_repository_free(git_repository *repo);
*
* TODO:
* - Reinit the repository
* - Create config files
*
* @param repo_out pointer to the repo which will be created or reinitialized
* @param path the path to the repository
...
...
@@ -146,8 +145,43 @@ GIT_EXTERN(int) git_repository_head_orphan(git_repository *repo);
*/
GIT_EXTERN
(
int
)
git_repository_is_empty
(
git_repository
*
repo
);
/**
* Get the path of this repository
*
* This is the path of the `.git` folder for normal repositories,
* or of the repository itself for bare repositories.
*
* @param repo A repository object
* @return the path to the repository
*/
GIT_EXTERN
(
const
char
*
)
git_repository_path
(
git_repository
*
repo
);
/**
* Get the path of the working directory for this repository
*
* If the repository is bare, this function will always return
* NULL.
*
* @param repo A repository object
* @return the path to the working dir, if it exists
*/
GIT_EXTERN
(
const
char
*
)
git_repository_workdir
(
git_repository
*
repo
);
/**
* Set the path to the working directory for this repository
*
* 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 repo A repository object
* @param workdir The path to a working directory
* @return GIT_SUCCESS, or an error code
*/
GIT_EXTERN
(
int
)
git_repository_set_workdir
(
git_repository
*
repo
,
const
char
*
workdir
);
/**
...
...
@@ -158,13 +192,97 @@ GIT_EXTERN(int) git_repository_set_workdir(git_repository *repo, const char *wor
*/
GIT_EXTERN
(
int
)
git_repository_is_bare
(
git_repository
*
repo
);
/**
* Get the configuration file for this repository.
*
* 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.
*
* @param out Pointer to store the loaded config file
* @param repo A repository object
* @return GIT_SUCCESS, or an error code
*/
GIT_EXTERN
(
int
)
git_repository_config
(
git_config
**
out
,
git_repository
*
repo
);
/**
* Set the configuration file for this repository
*
* 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 repo A repository object
* @param config A Config object
*/
GIT_EXTERN
(
void
)
git_repository_set_config
(
git_repository
*
repo
,
git_config
*
config
);
/**
* Get the Object Database for this repository.
*
* 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.
*
* @param out Pointer to store the loaded ODB
* @param repo A repository object
* @return GIT_SUCCESS, or an error code
*/
GIT_EXTERN
(
int
)
git_repository_odb
(
git_odb
**
out
,
git_repository
*
repo
);
/**
* Set the Object Database for this repository
*
* 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 repo A repository object
* @param odb An ODB object
*/
GIT_EXTERN
(
void
)
git_repository_set_odb
(
git_repository
*
repo
,
git_odb
*
odb
);
/**
* Get the Index file for this repository.
*
* 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.
*
* @param out Pointer to store the loaded index
* @param repo A repository object
* @return GIT_SUCCESS, or an error code
*/
GIT_EXTERN
(
int
)
git_repository_index
(
git_index
**
out
,
git_repository
*
repo
);
/**
* Set the index file for this repository
*
* 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 repo A repository object
* @param index An index object
*/
GIT_EXTERN
(
void
)
git_repository_set_index
(
git_repository
*
repo
,
git_index
*
index
);
/** @} */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment