wrapper.c: add and use fopen_or_warn()
[gitweb.git] / builtin / commit.c
index 1d805f5da8abd1cfafc41c5c47fd048b2549fbf4..eda0d3231165b54a12339fe2550c1e6688fc3843 100644 (file)
@@ -1695,10 +1695,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
                if (!reflog_msg)
                        reflog_msg = "commit (merge)";
                pptr = commit_list_append(current_head, pptr);
-               fp = fopen(git_path_merge_head(), "r");
-               if (fp == NULL)
-                       die_errno(_("could not open '%s' for reading"),
-                                 git_path_merge_head());
+               fp = xfopen(git_path_merge_head(), "r");
                while (strbuf_getline_lf(&m, fp) != EOF) {
                        struct commit *parent;