Merge branch 'rs/xopen-reports-open-failures'
Error diagnostics improvement. * rs/xopen-reports-open-failures: use xopen() to handle fatal open(2) failures xopen: explicitly report creation failures
This commit is contained in:
@ -1138,9 +1138,7 @@ static void handle_fetch_head(struct commit_list **remotes, struct strbuf *merge
|
||||
merge_names = &fetch_head_file;
|
||||
|
||||
filename = git_path_fetch_head(the_repository);
|
||||
fd = open(filename, O_RDONLY);
|
||||
if (fd < 0)
|
||||
die_errno(_("could not open '%s' for reading"), filename);
|
||||
fd = xopen(filename, O_RDONLY);
|
||||
|
||||
if (strbuf_read(merge_names, fd, 0) < 0)
|
||||
die_errno(_("could not read '%s'"), filename);
|
||||
|
Reference in New Issue
Block a user