diff options
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/tree.h | 8 | ||||
-rw-r--r-- | include/git2/types.h | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/include/git2/tree.h b/include/git2/tree.h index 29aedacc6..e5261417c 100644 --- a/include/git2/tree.h +++ b/include/git2/tree.h @@ -143,9 +143,9 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byoid(git_tree *tree, const gi * Get the UNIX file attributes of a tree entry * * @param entry a tree entry - * @return attributes as an integer + * @return filemode as an integer */ -GIT_EXTERN(unsigned int) git_tree_entry_attributes(const git_tree_entry *entry); +GIT_EXTERN(git_filemode_t) git_tree_entry_filemode(const git_tree_entry *entry); /** * Get the filename of a tree entry @@ -271,7 +271,7 @@ GIT_EXTERN(const git_tree_entry *) git_treebuilder_get(git_treebuilder *bld, con * @param bld Tree builder * @param filename Filename of the entry * @param id SHA1 oid of the entry - * @param attributes Folder attributes of the entry. This parameter must + * @param filemode Folder attributes of the entry. This parameter must * be valued with one of the following entries: 0040000, 0100644, * 0100755, 0120000 or 0160000. * @return 0 or an error code @@ -281,7 +281,7 @@ GIT_EXTERN(int) git_treebuilder_insert( git_treebuilder *bld, const char *filename, const git_oid *id, - unsigned int attributes); + git_filemode_t filemode); /** * Remove an entry from the builder by its filename diff --git a/include/git2/types.h b/include/git2/types.h index acd5a73bc..d3a905372 100644 --- a/include/git2/types.h +++ b/include/git2/types.h @@ -175,6 +175,16 @@ typedef enum { GIT_RESET_MIXED = 2, } git_reset_type; +/** Valid modes for index and tree entries. */ +typedef enum { + GIT_FILEMODE_NEW = 0000000, + GIT_FILEMODE_TREE = 0040000, + GIT_FILEMODE_BLOB = 0100644, + GIT_FILEMODE_BLOB_EXECUTABLE = 0100755, + GIT_FILEMODE_LINK = 0120000, + GIT_FILEMODE_COMMIT = 0160000, +} git_filemode_t; + typedef struct git_refspec git_refspec; typedef struct git_remote git_remote; |