aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c42
1 files changed, 16 insertions, 26 deletions
diff --git a/config.c b/config.c
index 50f2d17b39..095a17bd42 100644
--- a/config.c
+++ b/config.c
@@ -19,6 +19,7 @@
#include "convert.h"
#include "environment.h"
#include "gettext.h"
+#include "git-zlib.h"
#include "ident.h"
#include "repository.h"
#include "lockfile.h"
@@ -30,7 +31,7 @@
#include "hashmap.h"
#include "string-list.h"
#include "object-name.h"
-#include "object-store-ll.h"
+#include "odb.h"
#include "pager.h"
#include "path.h"
#include "utf8.h"
@@ -1436,11 +1437,6 @@ static int git_default_core_config(const char *var, const char *value,
return git_config_pathname(&git_attributes_file, var, value);
}
- if (!strcmp(var, "core.hookspath")) {
- FREE_AND_NULL(git_hooks_path);
- return git_config_pathname(&git_hooks_path, var, value);
- }
-
if (!strcmp(var, "core.bare")) {
is_bare_repository_cfg = git_config_bool(var, value);
return 0;
@@ -1494,11 +1490,6 @@ static int git_default_core_config(const char *var, const char *value,
return 0;
}
- if (!strcmp(var, "core.bigfilethreshold")) {
- big_file_threshold = git_config_ulong(var, value, ctx->kvi);
- return 0;
- }
-
if (!strcmp(var, "core.autocrlf")) {
if (value && !strcasecmp(value, "input")) {
auto_crlf = AUTO_CRLF_INPUT;
@@ -1604,11 +1595,6 @@ static int git_default_core_config(const char *var, const char *value,
return 0;
}
- if (!strcmp(var, "core.preloadindex")) {
- core_preload_index = git_config_bool(var, value);
- return 0;
- }
-
if (!strcmp(var, "core.createobject")) {
if (!value)
return config_error_nonbool(var);
@@ -1651,7 +1637,7 @@ static int git_default_core_config(const char *var, const char *value,
return 0;
}
- /* Add other config variables here and to Documentation/config.txt. */
+ /* Add other config variables here and to Documentation/config.adoc. */
return platform_core_config(var, value, ctx, cb);
}
@@ -1662,7 +1648,7 @@ static int git_default_sparse_config(const char *var, const char *value)
return 0;
}
- /* Add other config variables here and to Documentation/config/sparse.txt. */
+ /* Add other config variables here and to Documentation/config/sparse.adoc. */
return 0;
}
@@ -1678,7 +1664,7 @@ static int git_default_i18n_config(const char *var, const char *value)
return git_config_string(&git_log_output_encoding, var, value);
}
- /* Add other config variables here and to Documentation/config.txt. */
+ /* Add other config variables here and to Documentation/config.adoc. */
return 0;
}
@@ -1714,7 +1700,7 @@ static int git_default_branch_config(const char *var, const char *value)
return 0;
}
- /* Add other config variables here and to Documentation/config.txt. */
+ /* Add other config variables here and to Documentation/config.adoc. */
return 0;
}
@@ -1743,7 +1729,7 @@ static int git_default_push_config(const char *var, const char *value)
return 0;
}
- /* Add other config variables here and to Documentation/config.txt. */
+ /* Add other config variables here and to Documentation/config.adoc. */
return 0;
}
@@ -1759,7 +1745,7 @@ static int git_default_mailmap_config(const char *var, const char *value)
return git_config_string(&git_mailmap_blob, var, value);
}
- /* Add other config variables here and to Documentation/config.txt. */
+ /* Add other config variables here and to Documentation/config.adoc. */
return 0;
}
@@ -1772,7 +1758,7 @@ static int git_default_attr_config(const char *var, const char *value)
/*
* Add other attribute related config variables here and to
- * Documentation/config/attr.txt.
+ * Documentation/config/attr.adoc.
*/
return 0;
}
@@ -1830,7 +1816,7 @@ int git_default_config(const char *var, const char *value,
if (starts_with(var, "sparse."))
return git_default_sparse_config(var, value);
- /* Add other config variables here and to Documentation/config.txt. */
+ /* Add other config variables here and to Documentation/config.adoc. */
return 0;
}
@@ -1951,7 +1937,7 @@ int git_config_from_blob_oid(config_fn_t fn,
unsigned long size;
int ret;
- buf = repo_read_object_file(repo, oid, &type, &size);
+ buf = odb_read_object(repo->objects, oid, &type, &size);
if (!buf)
return error(_("unable to load config blob object '%s'"), name);
if (type != OBJ_BLOB) {
@@ -2525,6 +2511,10 @@ void repo_config_clear(struct repository *repo)
void repo_config(struct repository *repo, config_fn_t fn, void *data)
{
+ if (!repo) {
+ read_very_early_config(fn, data);
+ return;
+ }
git_config_check_init(repo);
configset_iter(repo->config, fn, data);
}
@@ -2945,7 +2935,7 @@ static ssize_t write_pair(int fd, const char *key, const char *value,
if (value[0] == ' ')
quote = "\"";
for (i = 0; value[i]; i++)
- if (value[i] == ';' || value[i] == '#')
+ if (value[i] == ';' || value[i] == '#' || value[i] == '\r')
quote = "\"";
if (i && value[i - 1] == ' ')
quote = "\"";