diff options
| author | Russell Belfer <rb@github.com> | 2014-01-28 11:45:06 -0800 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2014-01-30 09:59:59 -0800 |
| commit | c0644c3fbb31c381afb2d0658b5c6e83432fd8c9 (patch) | |
| tree | 420faf1e93d3191e9aae9e94915da2cd998c56d2 /src/submodule.c | |
| parent | 5572d2b8a1668f3c2f35ec91d3f864f28f8ef987 (diff) | |
| download | libgit2-c0644c3fbb31c381afb2d0658b5c6e83432fd8c9.tar.gz | |
Make submodule fetchRecurse match other options
This removes the fetchRecurse compiler warnings and makes the
behavior match the other submodule options (i.e. the in-memory
setting can be reset to the on-disk value).
Diffstat (limited to 'src/submodule.c')
| -rw-r--r-- | src/submodule.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/submodule.c b/src/submodule.c index 720681db9..2388bd144 100644 --- a/src/submodule.c +++ b/src/submodule.c @@ -498,6 +498,7 @@ int git_submodule_save(git_submodule *submodule) submodule->ignore_default = submodule->ignore; submodule->update_default = submodule->update; + submodule->fetch_recurse_default = submodule->fetch_recurse; submodule->flags |= GIT_SUBMODULE_STATUS_IN_CONFIG; cleanup: @@ -650,6 +651,9 @@ git_submodule_recurse_t git_submodule_set_fetch_recurse_submodules( assert(submodule); + if (fetch_recurse_submodules == GIT_SUBMODULE_RECURSE_RESET) + fetch_recurse_submodules = submodule->fetch_recurse_default; + old = submodule->fetch_recurse; submodule->fetch_recurse = fetch_recurse_submodules; return old; @@ -1000,7 +1004,7 @@ static git_submodule *submodule_alloc(git_repository *repo, const char *name) GIT_REFCOUNT_INC(sm); sm->ignore = sm->ignore_default = GIT_SUBMODULE_IGNORE_NONE; sm->update = sm->update_default = GIT_SUBMODULE_UPDATE_CHECKOUT; - sm->fetch_recurse = GIT_SUBMODULE_RECURSE_YES; + sm->fetch_recurse = sm->fetch_recurse_default = GIT_SUBMODULE_RECURSE_NO; sm->repo = repo; sm->branch = NULL; @@ -1218,6 +1222,7 @@ static int submodule_load_from_config( else if (strcasecmp(property, "fetchRecurseSubmodules") == 0) { if (git_submodule_parse_recurse(&sm->fetch_recurse, value) < 0) return -1; + sm->fetch_recurse_default = sm->fetch_recurse; } else if (strcasecmp(property, "ignore") == 0) { if ((error = git_submodule_parse_ignore(&sm->ignore, value)) < 0) |
