X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=config.c;h=5b5a9a2e4c49026db7fcb9953a0ed25432de24e0;hb=724b511d4fb363ebee828ba3992c831ba006444c;hp=0c43d7615b68cb41b60a140bdcf26559b24cc3e0;hpb=4f629539cd99fb9fc68dbdc56812f291565d0f87;p=git.git diff --git a/config.c b/config.c index 0c43d761..5b5a9a2e 100644 --- a/config.c +++ b/config.c @@ -11,7 +11,7 @@ #define MAXNAME (256) static FILE *config_file; -static char *config_file_name; +static const char *config_file_name; static int config_linenr; static int get_next_char(void) { @@ -237,6 +237,11 @@ int git_default_config(const char *var, const char *value) return 0; } + if (!strcmp(var, "i18n.commitencoding")) { + strncpy(git_commit_encoding, value, sizeof(git_commit_encoding)); + return 0; + } + /* Add other config variables here.. */ return 0; } @@ -453,12 +458,6 @@ int git_config_set_multivar(const char* key, const char* value, * If .git/config does not exist yet, write a minimal version. */ if (stat(config_filename, &st)) { - static const char contents[] = - "#\n" - "# This is the config file\n" - "#\n" - "\n"; - free(store.key); /* if nothing to unset, error out */ @@ -469,8 +468,6 @@ int git_config_set_multivar(const char* key, const char* value, } store.key = (char*)key; - - write(fd, contents, sizeof(contents)-1); store_write_section(fd, key); store_write_pair(fd, key, value); } else{