You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
environment: move access to "core.sparsecheckoutcone" into repo_settings
The setting "core.sparsecheckoutcone" is stored in the global
`core_sparse_checkout_cone` and is populated in config.c. Refactor the
code to store it in the variable `sparse_checkout_cone` in the struct
`repo_settings`.
Avoid redundant calls to `prepare_repo_settings()` where it is already
present:
- In "builtin/mv.c" and "builtin/sparse-checkout.c", it is already
invoked in their respective `cmd_*()` functions.
- In "sparse-index.c", `prepare_repo_settings()` is already called
before the setting is accessed.
- In "dir.c", `prepare_repo_settings()` is already called in all code
paths before the setting is accessed.
This change is part of an ongoing effort to eliminate global variables,
improve modularity and help libify the codebase.
Mentored-by: Christian Couder <[email protected]>
Mentored-by: Ghanshyam Thakkar <[email protected]>
Signed-off-by: Ayush Chandekar <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
if (the_repository->settings.sparse_checkout_cone)
765
765
die(_("'%s' is not a directory; to treat it as a directory anyway, rerun with --skip-checks"), args->v[i]);
766
766
else
767
767
warning(_("pass a leading slash before paths such as '%s' if you want a single file (see NON-CONE PROBLEMS in the git-sparse-checkout manual)."), args->v[i]);
0 commit comments