Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH v3 0/4] submodule config lookup API

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:04:52

Heiko Voigt [off-list ref] writes:
quoted hunk
This is finally the next iteration of the submodule config api. The last
iteration can be found here:

http://article.gmane.org/gmane.comp.version-control.git/252601

This iteration fixes the lookup of submodules by name
(submodule_from_name()) where one needed to pass in the gitmodule sha1
by mistake. To keep it simple for the user and behave as documented we
should take the commit sha1 which is now fixed here. We now also test
the lookup by name in the api tests.

This should be ready for inclusion.

Cheers Heiko

Here is the interdiff to the last iteration:
diff --git a/submodule-config.c b/submodule-config.c
index 96623ad..177767d 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -25,6 +25,11 @@ struct submodule_entry {
 	struct submodule *config;
 };
 
+enum lookup_type {
+	lookup_name,
+	lookup_path,
+};
Please lose the comma after the last element in enum.  Some
compilers do not like it, I was told.
+	switch (lookup_type) {
+		case lookup_name:
+			submodule = cache_lookup_name(cache, sha1, key);
+			break;
+		case lookup_path:
+			submodule = cache_lookup_path(cache, sha1, key);
+			break;
Is this too deeply indented?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help