@@ -231,30 +231,6 @@ static void show_config_scope(const struct config_display_options *opts,
231231 strbuf_addch (buf , term );
232232}
233233
234- static int show_all_config (const char * key_ , const char * value_ ,
235- const struct config_context * ctx ,
236- void * cb )
237- {
238- const struct config_display_options * opts = cb ;
239- const struct key_value_info * kvi = ctx -> kvi ;
240-
241- if (opts -> show_origin || opts -> show_scope ) {
242- struct strbuf buf = STRBUF_INIT ;
243- if (opts -> show_scope )
244- show_config_scope (opts , kvi , & buf );
245- if (opts -> show_origin )
246- show_config_origin (opts , kvi , & buf );
247- /* Use fwrite as "buf" can contain \0's if "end_null" is set. */
248- fwrite (buf .buf , 1 , buf .len , stdout );
249- strbuf_release (& buf );
250- }
251- if (!opts -> omit_values && value_ )
252- printf ("%s%c%s%c" , key_ , opts -> delim , value_ , opts -> term );
253- else
254- printf ("%s%c" , key_ , opts -> term );
255- return 0 ;
256- }
257-
258234struct strbuf_list {
259235 struct strbuf * items ;
260236 int nr ;
@@ -332,6 +308,30 @@ static int format_config(const struct config_display_options *opts,
332308 return 0 ;
333309}
334310
311+ static int show_all_config (const char * key_ , const char * value_ ,
312+ const struct config_context * ctx ,
313+ void * cb )
314+ {
315+ const struct config_display_options * opts = cb ;
316+ const struct key_value_info * kvi = ctx -> kvi ;
317+
318+ if (opts -> show_origin || opts -> show_scope ) {
319+ struct strbuf buf = STRBUF_INIT ;
320+ if (opts -> show_scope )
321+ show_config_scope (opts , kvi , & buf );
322+ if (opts -> show_origin )
323+ show_config_origin (opts , kvi , & buf );
324+ /* Use fwrite as "buf" can contain \0's if "end_null" is set. */
325+ fwrite (buf .buf , 1 , buf .len , stdout );
326+ strbuf_release (& buf );
327+ }
328+ if (!opts -> omit_values && value_ )
329+ printf ("%s%c%s%c" , key_ , opts -> delim , value_ , opts -> term );
330+ else
331+ printf ("%s%c" , key_ , opts -> term );
332+ return 0 ;
333+ }
334+
335335#define GET_VALUE_ALL (1 << 0)
336336#define GET_VALUE_KEY_REGEXP (1 << 1)
337337
0 commit comments