File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -692,6 +692,7 @@ extern int git_parse_long(const char *, long *);
692692extern int git_parse_ulong (const char * , unsigned long * );
693693extern int git_config_int (const char * , const char * );
694694extern unsigned long git_config_ulong (const char * , const char * );
695+ extern int git_config_bool_or_int (const char * , const char * , int * );
695696extern int git_config_bool (const char * , const char * );
696697extern int git_config_string (const char * * , const char * , const char * );
697698extern int git_config_set (const char * , const char * );
Original file line number Diff line number Diff line change @@ -303,8 +303,9 @@ unsigned long git_config_ulong(const char *name, const char *value)
303303 return ret ;
304304}
305305
306- int git_config_bool (const char * name , const char * value )
306+ int git_config_bool_or_int (const char * name , const char * value , int * is_bool )
307307{
308+ * is_bool = 1 ;
308309 if (!value )
309310 return 1 ;
310311 if (!* value )
@@ -313,9 +314,16 @@ int git_config_bool(const char *name, const char *value)
313314 return 1 ;
314315 if (!strcasecmp (value , "false" ) || !strcasecmp (value , "no" ))
315316 return 0 ;
317+ * is_bool = 0 ;
316318 return git_config_int (name , value ) != 0 ;
317319}
318320
321+ int git_config_bool (const char * name , const char * value )
322+ {
323+ int discard ;
324+ return git_config_bool_or_int (name , value , & discard );
325+ }
326+
319327int git_config_string (const char * * dest , const char * var , const char * value )
320328{
321329 if (!value )
You can’t perform that action at this time.
0 commit comments