git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv2 1/3] submodule config: inline config_from_{name, path}

From
Stefan Beller <sbeller@google.com>
Date
Nov 21, 2016, 23:27 UTC
Message-ID
<20161121232709.8906-2-sbeller@google.com>
In-Reply-To
<20161121232709.8906-1-sbeller@google.com>

There is no other user of config_from_{name, path}, such that there is no reason for the existence of these one liner functions. Just inline these to increase readability.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 submodule-config.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/submodule-config.c b/submodule-config.c
index 098085be69..15ffab6af4 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -471,18 +471,6 @@ static const struct submodule *config_from(struct submodule_cache *cache,
 	return submodule;
 }
 
-static const struct submodule *config_from_path(struct submodule_cache *cache,
-		const unsigned char *commit_sha1, const char *path)
-{
-	return config_from(cache, commit_sha1, path, lookup_path);
-}
-
-static const struct submodule *config_from_name(struct submodule_cache *cache,
-		const unsigned char *commit_sha1, const char *name)
-{
-	return config_from(cache, commit_sha1, name, lookup_name);
-}
-
 static void ensure_cache_init(void)
 {
 	if (is_cache_init)
@@ -508,14 +496,14 @@ const struct submodule *submodule_from_name(const unsigned char *commit_sha1,
 		const char *name)
 {
 	ensure_cache_init();
-	return config_from_name(&the_submodule_cache, commit_sha1, name);
+	return config_from(&the_submodule_cache, commit_sha1, name, lookup_name);
 }
 
 const struct submodule *submodule_from_path(const unsigned char *commit_sha1,
 		const char *path)
 {
 	ensure_cache_init();
-	return config_from_path(&the_submodule_cache, commit_sha1, path);
+	return config_from(&the_submodule_cache, commit_sha1, path, lookup_path);
 }
 
 void submodule_free(void)
-- 
2.11.0.rc2.18.g0126045.dirty
Previous: Stefan BellerNext: Junio C Hamano
Message 2 of 12 in “[PATCHv2 0/3] submodule-config: clarify/cleanup docs and header”
  1. Stefan BellerNov 21, 2016
  2. 1/3 submodule config: inline config_from_{name, path}Stefan Beller, Nov 21, 2016
  3. Junio C HamanoNov 22, 2016
  4. 2/3 submodule-config: rename commit_sha1 to commit_or_treeStefan Beller, Nov 21, 2016
  5. Brandon WilliamsNov 22, 2016
  6. Stefan BellerNov 22, 2016
  7. Brandon WilliamsNov 22, 2016
  8. Stefan BellerNov 22, 2016
  9. Junio C HamanoNov 22, 2016
  10. Stefan BellerNov 22, 2016
  11. 3/3 submodule-config: clarify parsing of null_sha1 elementStefan Beller, Nov 21, 2016
  12. Brandon WilliamsNov 22, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.