]> git.ipfire.org Git - thirdparty/git.git/blobdiff - submodule-config.h
Merge branch 'fr_2.18_round1' of git://github.com/jnavila/git
[thirdparty/git.git] / submodule-config.h
index 6f686184e86cc0004410aae3b771de4d3b488a13..ca1f94e2d2ed90f9ef4c588e27c0d8e15e1724ab 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef SUBMODULE_CONFIG_CACHE_H
 #define SUBMODULE_CONFIG_CACHE_H
 
+#include "cache.h"
 #include "hashmap.h"
 #include "submodule.h"
 #include "strbuf.h"
@@ -17,13 +18,13 @@ struct submodule {
        const char *ignore;
        const char *branch;
        struct submodule_update_strategy update_strategy;
-       /* the sha1 blob id of the responsible .gitmodules file */
-       unsigned char gitmodules_sha1[20];
+       /* the object id of the responsible .gitmodules file */
+       struct object_id gitmodules_oid;
        int recommend_shallow;
 };
 
 #define SUBMODULE_INIT { NULL, NULL, NULL, RECURSE_SUBMODULES_NONE, \
-       NULL, NULL, SUBMODULE_UPDATE_STRATEGY_INIT, {0}, -1 };
+       NULL, NULL, SUBMODULE_UPDATE_STRATEGY_INIT, { { 0 } }, -1 };
 
 struct submodule_cache;
 struct repository;
@@ -47,4 +48,11 @@ const struct submodule *submodule_from_path(struct repository *r,
                                            const char *path);
 void submodule_free(struct repository *r);
 
+/*
+ * Returns 0 if the name is syntactically acceptable as a submodule "name"
+ * (e.g., that may be found in the subsection of a .gitmodules file) and -1
+ * otherwise.
+ */
+int check_submodule_name(const char *name);
+
 #endif /* SUBMODULE_CONFIG_H */