diff options
author | Matthew Bowen <matthew@mgbowen.com> | 2014-03-05 21:49:23 -0500 |
---|---|---|
committer | Matthew Bowen <matthew@mgbowen.com> | 2014-03-05 21:49:23 -0500 |
commit | b9f819978c571cc806827e8b3ebc1a58a0755999 (patch) | |
tree | 64c94ef334360b064a3bdf9b6069c1422f727150 /src/status.c | |
parent | a064dc2d0b6206116a35be4b62c58c3c1170d5de (diff) | |
download | libgit2-b9f819978c571cc806827e8b3ebc1a58a0755999.tar.gz |
Added function-based initializers for every options struct.
The basic structure of each function is courtesy of arrbee.
Diffstat (limited to 'src/status.c')
-rw-r--r-- | src/status.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/status.c b/src/status.c index 3c95b347c..c4b990a84 100644 --- a/src/status.c +++ b/src/status.c @@ -495,3 +495,14 @@ int git_status_should_ignore( return git_ignore_path_is_ignored(ignored, repo, path); } +int git_status_init_options(git_status_options* opts, int version) +{ + if (version != GIT_STATUS_OPTIONS_VERSION) { + giterr_set(GITERR_INVALID, "Invalid version %d for git_status_options", version); + return -1; + } else { + git_status_options o = GIT_STATUS_OPTIONS_INIT; + memcpy(opts, &o, sizeof(o)); + return 0; + } +} |