forked from git-for-windows/git
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gvfs: add the core.gvfs config setting
This does not do anything yet. The next patches will add various values for that config setting that correspond to the various features offered/required by GVFS. Signed-off-by: Kevin Willford <kewillf@microsoft.com>
- Loading branch information
Showing
5 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,40 @@ | ||
#ifndef GVFS_H | ||
#define GVFS_H | ||
|
||
#include "environment.h" | ||
#include "config.h" | ||
|
||
/* | ||
* This file is for the specific settings and methods | ||
* used for GVFS functionality | ||
*/ | ||
|
||
static inline int gvfs_config_is_set(int mask) { | ||
return (core_gvfs & mask) == mask; | ||
} | ||
|
||
static inline int gvfs_config_is_set_any(void) { | ||
return core_gvfs > 0; | ||
} | ||
|
||
static inline void gvfs_load_config_value(const char *value) { | ||
int is_bool = 0; | ||
|
||
if (value) | ||
core_gvfs = git_config_bool_or_int("core.gvfs", value, &is_bool); | ||
else | ||
git_config_get_bool_or_int("core.gvfs", &is_bool, &core_gvfs); | ||
|
||
/* Turn on all bits if a bool was set in the settings */ | ||
if (is_bool && core_gvfs) | ||
core_gvfs = -1; | ||
} | ||
|
||
|
||
static inline int gvfs_config_load_and_is_set(int mask) { | ||
gvfs_load_config_value(0); | ||
return gvfs_config_is_set(mask); | ||
} | ||
|
||
|
||
#endif /* GVFS_H */ |