travis-ci: check that all build artifacts are .gitignore-d
[gitweb.git] / submodule-config.c
index eeb154a894d6bfdec877d94d5922438b5f934730..5fe2d0787745de4d97218c738b808667dc8348d3 100644 (file)
@@ -4,6 +4,7 @@
 #include "submodule-config.h"
 #include "submodule.h"
 #include "strbuf.h"
+#include "parse-options.h"
 
 /*
  * submodule cache lookup structure
@@ -252,6 +253,27 @@ int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg)
        return parse_fetch_recurse(opt, arg, 1);
 }
 
+int option_fetch_parse_recurse_submodules(const struct option *opt,
+                                         const char *arg, int unset)
+{
+       int *v;
+
+       if (!opt->value)
+               return -1;
+
+       v = opt->value;
+
+       if (unset) {
+               *v = RECURSE_SUBMODULES_OFF;
+       } else {
+               if (arg)
+                       *v = parse_fetch_recurse_submodules_arg(opt->long_name, arg);
+               else
+                       *v = RECURSE_SUBMODULES_ON;
+       }
+       return 0;
+}
+
 static int parse_update_recurse(const char *opt, const char *arg,
                                int die_on_error)
 {