git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] submodule-config: use explicit empty string instead of strbuf in config_from()
@ 2016-07-19 19:05 René Scharfe
  2016-07-19 19:15 ` Junio C Hamano
  2016-07-20  8:25 ` Heiko Voigt
  0 siblings, 2 replies; 23+ messages in thread
From: René Scharfe @ 2016-07-19 19:05 UTC (permalink / raw)
  To: Git List; +Cc: Stefan Beller, Lars Schneider, Heiko Voigt

Use a string constant instead of an empty strbuf to shorten the code
and make it easier to read.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
... unless someone can come up with a suitable non-empty string to feed
to git_config_from_mem() as its name parameter.

 submodule-config.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/submodule-config.c b/submodule-config.c
index db1847f..44eb162 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -397,7 +397,6 @@ static const struct submodule *config_from(struct submodule_cache *cache,
 		const unsigned char *commit_sha1, const char *key,
 		enum lookup_type lookup_type)
 {
-	struct strbuf rev = STRBUF_INIT;
 	unsigned long config_size;
 	char *config;
 	unsigned char sha1[20];
@@ -448,7 +447,7 @@ static const struct submodule *config_from(struct submodule_cache *cache,
 	parameter.commit_sha1 = commit_sha1;
 	parameter.gitmodules_sha1 = sha1;
 	parameter.overwrite = 0;
-	git_config_from_mem(parse_config, "submodule-blob", rev.buf,
+	git_config_from_mem(parse_config, "submodule-blob", "",
 			config, config_size, &parameter);
 	free(config);
 
-- 
2.9.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2016-08-17 17:46 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-19 19:05 [PATCH] submodule-config: use explicit empty string instead of strbuf in config_from() René Scharfe
2016-07-19 19:15 ` Junio C Hamano
2016-07-19 19:24   ` Stefan Beller
2016-07-20  8:25 ` Heiko Voigt
2016-07-21 18:57   ` René Scharfe
2016-07-25 14:37     ` Heiko Voigt
2016-07-25 14:58       ` Junio C Hamano
2016-07-26  9:49         ` [PATCH 1/2] fix passing a name for config from submodules Heiko Voigt
2016-07-26 17:22           ` Stefan Beller
2016-07-26 22:02             ` Junio C Hamano
2016-07-28 12:49               ` [PATCH 1/3] submodule-config: passing name reference for .gitmodule blobs Heiko Voigt
2016-07-28 16:26                 ` Stefan Beller
2016-07-28 12:49               ` [PATCH 2/3] submodule-config: combine early return code into one goto Heiko Voigt
2016-07-28 12:50               ` [PATCH 3/3] submodule-config: fix test binary crashing when no arguments given Heiko Voigt
2016-07-28 11:17             ` [PATCH 1/2] fix passing a name for config from submodules Heiko Voigt
2016-07-28 12:55               ` [PATCH] document how to reference previous commits Heiko Voigt
2016-07-28 15:38                 ` Junio C Hamano
2016-07-28 15:57                   ` Stefan Beller
2016-08-17 11:36                 ` Heiko Voigt
2016-08-17 17:45                   ` Junio C Hamano
2016-07-28 14:59               ` [PATCH 1/2] fix passing a name for config from submodules Junio C Hamano
2016-07-26  9:49         ` [PATCH 2/2] submodule-config: combine error checking if clauses Heiko Voigt
2016-07-26 17:24           ` Stefan Beller

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).