]> asedeno.scripts.mit.edu Git - git.git/blobdiff - config.c
Merge branch 'master' of git://repo.or.cz/git/fastimport
[git.git] / config.c
index 733fb1a34cf809c79c86bc6f7136e9d98ef6cdf9..d82107124a53bca99ee65ea31dceb3871bf6796f 100644 (file)
--- a/config.c
+++ b/config.c
@@ -269,6 +269,11 @@ int git_default_config(const char *var, const char *value)
                return 0;
        }
 
+       if (!strcmp(var, "core.bare")) {
+               is_bare_repository_cfg = git_config_bool(var, value);
+               return 0;
+       }
+
        if (!strcmp(var, "core.ignorestat")) {
                assume_unchanged = git_config_bool(var, value);
                return 0;
@@ -656,6 +661,11 @@ int git_config_set_multivar(const char* key, const char* value,
                                goto out_free;
                        }
                        c = tolower(c);
+               } else if (c == '\n') {
+                       fprintf(stderr, "invalid key (newline): %s\n", key);
+                       free(store.key);
+                       ret = 1;
+                       goto out_free;
                }
                store.key[i] = c;
        }
@@ -886,7 +896,7 @@ int git_config_rename_section(const char *old_name, const char *new_name)
                                if (buf[i] != old_name[j++])
                                        break;
                        }
-                       if (buf[i] == ']') {
+                       if (buf[i] == ']' && old_name[j] == 0) {
                                /* old_name matches */
                                ret++;
                                store.baselen = strlen(new_name);