diff options
author | Vicent Martà <vicent@github.com> | 2012-08-21 14:32:09 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2012-08-21 14:32:09 -0700 |
commit | 697665c0c13e45a5d24af85c133ffaa0a0e0f8cc (patch) | |
tree | 9e32cfadd2e1ffaa05f72dd5871551180ee0afb9 /include/git2 | |
parent | b2be351aaddc6ba0b3a0f2cf4e09536a3b27e598 (diff) | |
parent | 9d7ac675d06dab2e000ad32f9248631af0191f85 (diff) | |
download | libgit2-697665c0c13e45a5d24af85c133ffaa0a0e0f8cc.tar.gz |
Merge pull request #889 from nulltoken/filemode-enum
Filemode enum
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; |