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 *);
692
692
extern int git_parse_ulong (const char * , unsigned long * );
693
693
extern int git_config_int (const char * , const char * );
694
694
extern unsigned long git_config_ulong (const char * , const char * );
695
+ extern int git_config_bool_or_int (const char * , const char * , int * );
695
696
extern int git_config_bool (const char * , const char * );
696
697
extern int git_config_string (const char * * , const char * , const char * );
697
698
extern 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)
303
303
return ret ;
304
304
}
305
305
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 )
307
307
{
308
+ * is_bool = 1 ;
308
309
if (!value )
309
310
return 1 ;
310
311
if (!* value )
@@ -313,9 +314,16 @@ int git_config_bool(const char *name, const char *value)
313
314
return 1 ;
314
315
if (!strcasecmp (value , "false" ) || !strcasecmp (value , "no" ))
315
316
return 0 ;
317
+ * is_bool = 0 ;
316
318
return git_config_int (name , value ) != 0 ;
317
319
}
318
320
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
+
319
327
int git_config_string (const char * * dest , const char * var , const char * value )
320
328
{
321
329
if (!value )
You can’t perform that action at this time.
0 commit comments