File tree Expand file tree Collapse file tree 3 files changed +43
-29
lines changed Expand file tree Collapse file tree 3 files changed +43
-29
lines changed Original file line number Diff line number Diff line change @@ -1042,6 +1042,7 @@ LIB_OBJS += git-zlib.o
1042
1042
LIB_OBJS += gpg-interface.o
1043
1043
LIB_OBJS += graph.o
1044
1044
LIB_OBJS += grep.o
1045
+ LIB_OBJS += gvfs.o
1045
1046
LIB_OBJS += hash-lookup.o
1046
1047
LIB_OBJS += hashmap.o
1047
1048
LIB_OBJS += help.o
Original file line number Diff line number Diff line change
1
+ #include "git-compat-util.h"
2
+ #include "environment.h"
3
+ #include "gvfs.h"
4
+ #include "setup.h"
5
+ #include "config.h"
6
+
7
+ static int gvfs_config_loaded ;
8
+ static int core_gvfs_is_bool ;
9
+
10
+ static int early_core_gvfs_config (const char * var , const char * value , void * data )
11
+ {
12
+ if (!strcmp (var , "core.gvfs" ))
13
+ core_gvfs = git_config_bool_or_int ("core.gvfs" , value , & core_gvfs_is_bool );
14
+ return 0 ;
15
+ }
16
+
17
+ void gvfs_load_config_value (const char * value )
18
+ {
19
+ if (gvfs_config_loaded )
20
+ return ;
21
+
22
+ if (value )
23
+ core_gvfs = git_config_bool_or_int ("core.gvfs" , value , & core_gvfs_is_bool );
24
+ else if (startup_info -> have_repository == 0 )
25
+ read_early_config (early_core_gvfs_config , NULL );
26
+ else
27
+ git_config_get_bool_or_int ("core.gvfs" , & core_gvfs_is_bool , & core_gvfs );
28
+
29
+ /* Turn on all bits if a bool was set in the settings */
30
+ if (core_gvfs_is_bool && core_gvfs )
31
+ core_gvfs = -1 ;
32
+
33
+ gvfs_config_loaded = 1 ;
34
+ }
35
+
36
+ int gvfs_config_is_set (int mask )
37
+ {
38
+ gvfs_load_config_value (NULL );
39
+ return (core_gvfs & mask ) == mask ;
40
+ }
Original file line number Diff line number Diff line change 1
1
#ifndef GVFS_H
2
2
#define GVFS_H
3
3
4
- #include "environment.h"
5
- #include "config.h"
6
4
7
5
/*
8
6
* This file is for the specific settings and methods
19
17
#define GVFS_FETCH_SKIP_REACHABILITY_AND_UPLOADPACK (1 << 4)
20
18
#define GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS (1 << 6)
21
19
22
- static inline int gvfs_config_is_set (int mask ) {
23
- return (core_gvfs & mask ) == mask ;
24
- }
25
-
26
- static inline int gvfs_config_is_set_any (void ) {
27
- return core_gvfs > 0 ;
28
- }
29
-
30
- static inline void gvfs_load_config_value (const char * value ) {
31
- int is_bool = 0 ;
32
-
33
- if (value )
34
- core_gvfs = git_config_bool_or_int ("core.gvfs" , value , & is_bool );
35
- else
36
- git_config_get_bool_or_int ("core.gvfs" , & is_bool , & core_gvfs );
37
-
38
- /* Turn on all bits if a bool was set in the settings */
39
- if (is_bool && core_gvfs )
40
- core_gvfs = -1 ;
41
- }
42
-
43
-
44
- static inline int gvfs_config_load_and_is_set (int mask ) {
45
- gvfs_load_config_value (0 );
46
- return gvfs_config_is_set (mask );
47
- }
48
-
20
+ void gvfs_load_config_value (const char * value );
21
+ int gvfs_config_is_set (int mask );
49
22
50
23
#endif /* GVFS_H */
You can’t perform that action at this time.
0 commit comments