Commit 13bd14d9 by Yuang Li

add feature flag for shallow clone support

parent e07aa9c3
......@@ -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
......
......@@ -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;
......
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