compat: die when unable to set core.precomposeunicode

When calling `git_config_set` to set 'core.precomposeunicode' we ignore the return value of the function, which may indicate that we were unable to write the value back to disk. As the function is only called by init-db we can and should die when an error occurs. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Feb 22, 2016 at 12:23 UTC 2f29c1bf34ec12c24072bb54a2c009bd1f17a2ee
1 file changed +2 -1
compat/precompose_utf8.c
+2 -1
@@ -50,7 +50,8 @@ void probe_utf8_pathname_composition(void)
50 close(output_fd);
51 git_path_buf(&path, "%s", auml_nfd);
52 precomposed_unicode = access(path.buf, R_OK) ? 0 : 1;
53 - git_config_set("core.precomposeunicode", precomposed_unicode ? "true" : "false");
53 + git_config_set_or_die("core.precomposeunicode",
54 + precomposed_unicode ? "true" : "false");
55 git_path_buf(&path, "%s", auml_nfc);
56 if (unlink(path.buf))
57 die_errno(_("failed to unlink '%s'"), path.buf);