diff options
| author | Vicent Martà <vicent@github.com> | 2012-06-19 15:17:35 -0700 | 
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2012-06-19 15:17:35 -0700 | 
| commit | c3ce8d0c9a8c9510e713babf1110b2df84f0aa88 (patch) | |
| tree | 10e30e40f64f7008ac49b0a557b9cb2a164ba8e1 /include/git2/index.h | |
| parent | 5232994072862de1358a2a0b14dda14e018f02e6 (diff) | |
| parent | 77d65af4398c6e2b7b7d54cbc10857f02132740e (diff) | |
| download | libgit2-c3ce8d0c9a8c9510e713babf1110b2df84f0aa88.tar.gz | |
Merge pull request #775 from arrbee/fix-index-filemodes
Make index add/append support core.filemode flag
Diffstat (limited to 'include/git2/index.h')
| -rw-r--r-- | include/git2/index.h | 29 | 
1 files changed, 29 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h index 0fb0f955a..f863a6065 100644 --- a/include/git2/index.h +++ b/include/git2/index.h @@ -90,6 +90,14 @@ typedef struct git_index_entry_unmerged {  	char *path;  } git_index_entry_unmerged; +/** Capabilities of system that affect index actions. */ +enum { +	GIT_INDEXCAP_IGNORE_CASE = 1, +	GIT_INDEXCAP_NO_FILEMODE = 2, +	GIT_INDEXCAP_NO_SYMLINKS = 4, +	GIT_INDEXCAP_FROM_OWNER  = ~0u +}; +  /**   * Create a new bare Git index object as a memory representation   * of the Git index file in 'index_path', without a repository @@ -127,6 +135,27 @@ GIT_EXTERN(void) git_index_clear(git_index *index);  GIT_EXTERN(void) git_index_free(git_index *index);  /** + * Read index capabilities flags. + * + * @param index An existing index object + * @return A combination of GIT_INDEXCAP values + */ +GIT_EXTERN(unsigned int) git_index_caps(const git_index *index); + +/** + * Set index capabilities flags. + * + * If you pass `GIT_INDEXCAP_FROM_OWNER` for the caps, then the + * capabilities will be read from the config of the owner object, + * looking at `core.ignorecase`, `core.filemode`, `core.symlinks`. + * + * @param index An existing index object + * @param caps A combination of GIT_INDEXCAP values + * @return 0 on success, -1 on failure + */ +GIT_EXTERN(int) git_index_set_caps(git_index *index, unsigned int caps); + +/**   * Update the contents of an existing index object in memory   * by reading from the hard disk.   *  | 
