diff options
-rw-r--r-- | include/git2/common.h | 6 | ||||
-rw-r--r-- | src/libgit2.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/git2/common.h b/include/git2/common.h index 2ee829025..dff64103d 100644 --- a/include/git2/common.h +++ b/include/git2/common.h @@ -211,7 +211,8 @@ typedef enum { GIT_OPT_SET_ODB_PACKED_PRIORITY, GIT_OPT_SET_ODB_LOOSE_PRIORITY, GIT_OPT_GET_EXTENSIONS, - GIT_OPT_SET_EXTENSIONS + GIT_OPT_SET_EXTENSIONS, + GIT_OPT_ENABLE_SHALLOW } git_libgit2_opt_t; /** @@ -448,6 +449,9 @@ typedef enum { * > { "!noop", "newext" } indicates that the caller does not want * > to support repositories with the `noop` extension but does want * > to support repositories with the `newext` extension. + * + * opts(GIT_OPT_ENABLE_SHALLOW, int enabled) + * > Enable or disable shallow clone support completely. * * @param option Option key * @param ... value to set the option diff --git a/src/libgit2.c b/src/libgit2.c index cc793b458..4eef2c618 100644 --- a/src/libgit2.c +++ b/src/libgit2.c @@ -390,6 +390,10 @@ int git_libgit2_opts(int key, ...) } break; + case GIT_OPT_ENABLE_SHALLOW: + git_cache__enabled = (va_arg(ap, int) != 0); + break; + default: git_error_set(GIT_ERROR_INVALID, "invalid option key"); error = -1; |