travis-ci: record and skip successfully built trees
[gitweb.git] / builtin / submodule--helper.c
index cbb17a90212cb7fadc00b36d16dd770ff93bbef0..3a3c9ca72b678f1a446013cc17cc36caa3e47355 100644 (file)
@@ -1,5 +1,7 @@
 #include "builtin.h"
+#include "repository.h"
 #include "cache.h"
+#include "config.h"
 #include "parse-options.h"
 #include "quote.h"
 #include "pathspec.h"
@@ -232,8 +234,7 @@ static int module_list_compute(int argc, const char **argv,
        int i, result = 0;
        char *ps_matched = NULL;
        parse_pathspec(pathspec, 0,
-                      PATHSPEC_PREFER_FULL |
-                      PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP,
+                      PATHSPEC_PREFER_FULL,
                       prefix, argv);
 
        if (pathspec->nr)
@@ -279,7 +280,7 @@ static void module_list_active(struct module_list *list)
        for (i = 0; i < list->nr; i++) {
                const struct cache_entry *ce = list->entries[i];
 
-               if (!is_submodule_initialized(ce->name))
+               if (!is_submodule_active(the_repository, ce->name))
                        continue;
 
                ALLOC_GROW(active_modules.entries,
@@ -361,7 +362,7 @@ static void init_submodule(const char *path, const char *prefix, int quiet)
         *
         * Set active flag for the submodule being initialized
         */
-       if (!is_submodule_initialized(path)) {
+       if (!is_submodule_active(the_repository, path)) {
                strbuf_reset(&sb);
                strbuf_addf(&sb, "submodule.%s.active", sub->name);
                git_config_set_gently(sb.buf, "true");
@@ -816,7 +817,7 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
        }
 
        /* Check if the submodule has been initialized. */
-       if (!is_submodule_initialized(ce->name)) {
+       if (!is_submodule_active(the_repository, ce->name)) {
                next_submodule_warn_missing(suc, out, displaypath);
                goto cleanup;
        }
@@ -929,7 +930,7 @@ static int update_clone_task_finished(int result,
        const struct cache_entry *ce;
        struct submodule_update_clone *suc = suc_cb;
 
-       int *idxP = *(int**)idx_task_cb;
+       int *idxP = idx_task_cb;
        int idx = *idxP;
        free(idxP);
 
@@ -1192,7 +1193,7 @@ static int is_active(int argc, const char **argv, const char *prefix)
 
        gitmodules_config();
 
-       return !is_submodule_initialized(argv[1]);
+       return !is_submodule_active(the_repository, argv[1]);
 }
 
 #define SUPPORT_SUPER_PREFIX (1<<0)
@@ -1221,9 +1222,8 @@ static struct cmd_struct commands[] = {
 int cmd_submodule__helper(int argc, const char **argv, const char *prefix)
 {
        int i;
-       if (argc < 2)
-               die(_("submodule--helper subcommand must be "
-                     "called with a subcommand"));
+       if (argc < 2 || !strcmp(argv[1], "-h"))
+               usage("git submodule--helper <command>");
 
        for (i = 0; i < ARRAY_SIZE(commands); i++) {
                if (!strcmp(argv[1], commands[i].cmd)) {