diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-11-25 08:16:26 +0100 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-11-26 08:37:08 +0100 |
| commit | 9462c471435b4de74848408bebe41d770dc49a50 (patch) | |
| tree | aac5e696d1b3e7b4cba64082b28255e5c4593b66 /include/git2/remote.h | |
| parent | 880b6f0c22153db164ecb3a18c362ba8337365d3 (diff) | |
| download | libgit2-9462c471435b4de74848408bebe41d770dc49a50.tar.gz | |
repository: Change ownership semantics
The ownership semantics have been changed all over the library to be
consistent. There are no more "borrowed" or duplicated references.
Main changes:
- `git_repository_open2` and `3` have been dropped.
- Added setters and getters to hotswap all the repository owned
objects:
`git_repository_index`
`git_repository_set_index`
`git_repository_odb`
`git_repository_set_odb`
`git_repository_config`
`git_repository_set_config`
`git_repository_workdir`
`git_repository_set_workdir`
Now working directories/index files/ODBs and so on can be
hot-swapped after creating a repository and between operations.
- All these objects now have proper ownership semantics with
refcounting: they all require freeing after they are no longer
needed (the repository always keeps its internal reference).
- Repository open and initialization has been updated to keep in
mind the configuration files. Bare repositories are now always
detected, and a default config file is created on init.
- All the tests affected by these changes have been dropped from the
old test suite and ported to the new one.
Diffstat (limited to 'include/git2/remote.h')
| -rw-r--r-- | include/git2/remote.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h index 43bbe9e1c..2bc2d16ec 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -39,7 +39,7 @@ GIT_BEGIN_DECL * @param name the remote's name * @return GIT_SUCCESS or an error code */ -int git_remote_new(git_remote **out, git_repository *repo, const char *url, const char *name); +GIT_EXTERN(int) git_remote_new(git_remote **out, git_repository *repo, const char *url, const char *name); /** * Get the information for a particular remote @@ -49,7 +49,7 @@ int git_remote_new(git_remote **out, git_repository *repo, const char *url, cons * @param name the remote's name * @return GIT_SUCCESS or an error code */ -GIT_EXTERN(int) git_remote_get(struct git_remote **out, struct git_config *cfg, const char *name); +GIT_EXTERN(int) git_remote_load(git_remote **out, git_repository *repo, const char *name); /** * Get the remote's name @@ -57,7 +57,7 @@ GIT_EXTERN(int) git_remote_get(struct git_remote **out, struct git_config *cfg, * @param remote the remote * @return a pointer to the name */ -GIT_EXTERN(const char *) git_remote_name(struct git_remote *remote); +GIT_EXTERN(const char *) git_remote_name(git_remote *remote); /** * Get the remote's url @@ -65,7 +65,7 @@ GIT_EXTERN(const char *) git_remote_name(struct git_remote *remote); * @param remote the remote * @return a pointer to the url */ -GIT_EXTERN(const char *) git_remote_url(struct git_remote *remote); +GIT_EXTERN(const char *) git_remote_url(git_remote *remote); /** * Get the fetch refspec @@ -73,7 +73,7 @@ GIT_EXTERN(const char *) git_remote_url(struct git_remote *remote); * @param remote the remote * @return a pointer to the fetch refspec or NULL if it doesn't exist */ -GIT_EXTERN(const git_refspec *) git_remote_fetchspec(struct git_remote *remote); +GIT_EXTERN(const git_refspec *) git_remote_fetchspec(git_remote *remote); /** * Get the push refspec @@ -82,7 +82,7 @@ GIT_EXTERN(const git_refspec *) git_remote_fetchspec(struct git_remote *remote); * @return a pointer to the push refspec or NULL if it doesn't exist */ -GIT_EXTERN(const git_refspec *) git_remote_pushspec(struct git_remote *remote); +GIT_EXTERN(const git_refspec *) git_remote_pushspec(git_remote *remote); /** * Open a connection to a remote @@ -95,7 +95,7 @@ GIT_EXTERN(const git_refspec *) git_remote_pushspec(struct git_remote *remote); * @param direction whether you want to receive or send data * @return GIT_SUCCESS or an error code */ -GIT_EXTERN(int) git_remote_connect(struct git_remote *remote, int direction); +GIT_EXTERN(int) git_remote_connect(git_remote *remote, int direction); /** * Get a list of refs at the remote @@ -149,7 +149,7 @@ GIT_EXTERN(void) git_remote_disconnect(git_remote *remote); * * @param remote the remote to free */ -GIT_EXTERN(void) git_remote_free(struct git_remote *remote); +GIT_EXTERN(void) git_remote_free(git_remote *remote); /** * Update the tips to the new state @@ -159,7 +159,7 @@ GIT_EXTERN(void) git_remote_free(struct git_remote *remote); * * @param remote the remote to update */ -GIT_EXTERN(int) git_remote_update_tips(struct git_remote *remote); +GIT_EXTERN(int) git_remote_update_tips(git_remote *remote); /** @} */ GIT_END_DECL |
