summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2012-03-28 16:45:36 -0700
committerRussell Belfer <arrbee@arrbee.com>2012-03-28 16:45:36 -0700
commitbfc9ca595aa2f189743f2a7b9812f05def78ec88 (patch)
treebfb9ade537f03433d1d1876045e4c5f2d56f3ccc /src/config.c
parent277e304149011bb615ae258e25492350cbfd4d46 (diff)
downloadlibgit2-bfc9ca595aa2f189743f2a7b9812f05def78ec88.tar.gz
Added submodule API and use in status
When processing status for a newly checked out repo, it is possible that there will be submodules that have not yet been initialized. The only way to distinguish these from untracked directories is to have some knowledge of submodules. This commit adds a new submodule API which, given a name or path, can determine if it appears to be a submodule and can give information about the submodule.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c
index 77598d6a6..5ef1a24b3 100644
--- a/src/config.c
+++ b/src/config.c
@@ -201,7 +201,7 @@ int git_config_set_string(git_config *cfg, const char *name, const char *value)
return file->set(file, name, value);
}
-static int parse_bool(int *out, const char *value)
+int git_config_parse_bool(int *out, const char *value)
{
/* A missing value means true */
if (value == NULL) {
@@ -301,7 +301,7 @@ int git_config_get_mapped(git_config *cfg, const char *name, git_cvar_map *maps,
case GIT_CVAR_TRUE: {
int bool_val;
- if (parse_bool(&bool_val, value) == 0 &&
+ if (git_config_parse_bool(&bool_val, value) == 0 &&
bool_val == (int)m->cvar_type) {
*out = m->map_value;
return 0;
@@ -372,7 +372,7 @@ int git_config_get_bool(git_config *cfg, const char *name, int *out)
if (ret < 0)
return ret;
- if (parse_bool(out, value) == 0)
+ if (git_config_parse_bool(out, value) == 0)
return 0;
if (parse_int32(out, value) == 0) {