diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-11-05 03:20:17 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2010-11-05 03:20:17 +0200 |
commit | 1795f87952a68155a618523799f70473483c7265 (patch) | |
tree | 239c2fef7674cc0407523be0a250b563361efc6b /src/git/index.h | |
parent | 1714826fa08ad8612b720c8fdea636a4fc49c480 (diff) | |
download | libgit2-1795f87952a68155a618523799f70473483c7265.tar.gz |
Improve error handling
All initialization functions now return error codes instead of pointers.
Error codes are now properly propagated on most functions. Several new
and more specific error codes have been added in common.h
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git/index.h')
-rw-r--r-- | src/git/index.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/git/index.h b/src/git/index.h index 3b262355e..ee410865d 100644 --- a/src/git/index.h +++ b/src/git/index.h @@ -56,11 +56,12 @@ typedef struct git_index_entry { * If 'working _dir' is NULL (e.g for bare repositories), the * methods working on on-disk files will fail. * + * @param index the pointer for the new index * @param index_path the path to the index file in disk * @param working_dir working dir for the git repository - * @return the index object; NULL if the index could not be created + * @return 0 on success; error code otherwise */ -GIT_EXTERN(git_index *) git_index_alloc(const char *index_path, const char *working_dir); +GIT_EXTERN(int) git_index_open(git_index **index, const char *index_path, const char *working_dir); /** * Clear the contents (all the entries) of an index object. |