Commit 13bd14d9 by Yuang Li

add feature flag for shallow clone support

parent e07aa9c3
...@@ -211,7 +211,8 @@ typedef enum { ...@@ -211,7 +211,8 @@ typedef enum {
GIT_OPT_SET_ODB_PACKED_PRIORITY, GIT_OPT_SET_ODB_PACKED_PRIORITY,
GIT_OPT_SET_ODB_LOOSE_PRIORITY, GIT_OPT_SET_ODB_LOOSE_PRIORITY,
GIT_OPT_GET_EXTENSIONS, GIT_OPT_GET_EXTENSIONS,
GIT_OPT_SET_EXTENSIONS GIT_OPT_SET_EXTENSIONS,
GIT_OPT_ENABLE_SHALLOW
} git_libgit2_opt_t; } git_libgit2_opt_t;
/** /**
...@@ -448,6 +449,9 @@ typedef enum { ...@@ -448,6 +449,9 @@ typedef enum {
* > { "!noop", "newext" } indicates that the caller does not want * > { "!noop", "newext" } indicates that the caller does not want
* > to support repositories with the `noop` extension but does want * > to support repositories with the `noop` extension but does want
* > to support repositories with the `newext` extension. * > 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 option Option key
* @param ... value to set the option * @param ... value to set the option
......
...@@ -390,6 +390,10 @@ int git_libgit2_opts(int key, ...) ...@@ -390,6 +390,10 @@ int git_libgit2_opts(int key, ...)
} }
break; break;
case GIT_OPT_ENABLE_SHALLOW:
git_cache__enabled = (va_arg(ap, int) != 0);
break;
default: default:
git_error_set(GIT_ERROR_INVALID, "invalid option key"); git_error_set(GIT_ERROR_INVALID, "invalid option key");
error = -1; error = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment