aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-06-24 15:11:24 -0700
committerJunio C Hamano <gitster@pobox.com>2007-06-24 15:11:42 -0700
commit9378c16135100fb65ad575cd35074af166de1cab (patch)
treef50e7250e04919ccdc3cdd3e194fe52b5d502514 /config.c
parentaeb59328453cd4f438345ea79ff04c96bccbbbb8 (diff)
downloadgit-9378c16135100fb65ad575cd35074af166de1cab.tar.gz
git-9378c16135100fb65ad575cd35074af166de1cab.tar.xz
Add core.quotepath configuration variable.
We always quote "unusual" byte values in a pathname using C-string style, to make it safer for parsing scripts that do not handle NUL separated records well (or just too lazy to bother). The absolute minimum bytes that need to be quoted for this purpose are TAB, LF (and other control characters), double quote and backslash. However, we have also always quoted the bytes in high 8-bit range; this was partly because we were lazy and partly because we were being cautious. This introduces an internal "quote_path_fully" variable, and core.quotepath configuration variable to control it. When set to false, it does not quote bytes in high 8-bit range anymore but passes them intact. The variable defaults to "true" to retain the traditional behaviour for now. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/config.c b/config.c
index e323153ae..4de892633 100644
--- a/config.c
+++ b/config.c
@@ -271,6 +271,11 @@ int git_default_config(const char *var, const char *value)
return 0;
}
+ if (!strcmp(var, "core.quotepath")) {
+ quote_path_fully = git_config_bool(var, value);
+ return 0;
+ }
+
if (!strcmp(var, "core.symlinks")) {
has_symlinks = git_config_bool(var, value);
return 0;