+static int
+load_config(void)
+{
+ FILE *pipe = popen("git repo-config --list", "r");
+ char buffer[BUFSIZ];
+ char *name;
+
+ if (!pipe)
+ return ERR;
+
+ while ((name = fgets(buffer, sizeof(buffer), pipe))) {
+ char *value = strchr(name, '=');
+ int valuelen, namelen;
+
+ /* No boolean options, yet */
+ if (!value)
+ continue;
+
+ namelen = value - name;
+
+ *value++ = 0;
+ valuelen = strlen(value);
+ if (valuelen > 0)
+ value[valuelen - 1] = 0;
+
+ if (!strcmp(name, "i18n.commitencoding")) {
+ string_copy(opt_encoding, value);
+ }
+ }
+
+ if (ferror(pipe))
+ return ERR;
+
+ pclose(pipe);
+
+ return OK;
+}
+