update-index: do not die too early in a read-only repository.
[gitweb.git] / config.c
index c08c66890f0162fe69452927c48d6835178ed12d..d82107124a53bca99ee65ea31dceb3871bf6796f 100644 (file)
--- a/config.c
+++ b/config.c
@@ -896,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);