aboutsummaryrefslogtreecommitdiff
path: root/bisect.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2017-05-03 17:16:46 +0700
committerJunio C Hamano <gitster@pobox.com>2017-05-26 12:33:55 +0900
commit23a9e0712d76a63c5af1caeb816943f466f0300e (patch)
tree1b065a078058d664ed353f6da0c77842381a5645 /bisect.c
parentb0a642ac4624740187212aecec62b35a2eab38cb (diff)
downloadgit-23a9e0712d76a63c5af1caeb816943f466f0300e.tar.gz
git-23a9e0712d76a63c5af1caeb816943f466f0300e.tar.xz
use xfopen() in more places
xfopen() - provides error details - explains error on reading, or writing, or whatever operation - has l10n support - prints file name in the error Some of these are missing in the places that are replaced with xfopen(), which is a clear win. In some other places, it's just less code (not as clearly a win as the previous case but still is). The only slight regresssion is in remote-testsvn, where we don't report the file class (marks files) in the error messages anymore. But since this is a _test_ svn remote transport, I'm not too concerned. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bisect.c')
-rw-r--r--bisect.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/bisect.c b/bisect.c
index 08c9fb726..469a3e906 100644
--- a/bisect.c
+++ b/bisect.c
@@ -438,10 +438,7 @@ static void read_bisect_paths(struct argv_array *array)
{
struct strbuf str = STRBUF_INIT;
const char *filename = git_path_bisect_names();
- FILE *fp = fopen(filename, "r");
-
- if (!fp)
- die_errno(_("Could not open file '%s'"), filename);
+ FILE *fp = xfopen(filename, "r");
while (strbuf_getline_lf(&str, fp) != EOF) {
strbuf_trim(&str);