From: Nguyễn Thái Ngọc Duy Date: Thu, 20 Apr 2017 11:25:57 GMT Subject: [PATCH 03/15] blame: report error on open if graft_file is a directory Message-ID: <20170420112609.26089-4-pclouds@gmail.com> In-Reply-To: <20170420112609.26089-1-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/blame.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/blame.c b/builtin/blame.c index 07506a3e45..70afa1b05c 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -2073,8 +2073,11 @@ static int read_ancestry(const char *graft_file) { FILE *fp = fopen(graft_file, "r"); struct strbuf buf = STRBUF_INIT; - if (!fp) + if (!fp) { + if (errno != ENOENT) + warn_on_inaccessible(graft_file); return -1; + } while (!strbuf_getwholeline(&buf, fp, '\n')) { /* The format is just "Commit Parent1 Parent2 ...\n" */ struct commit_graft *graft = read_graft_line(buf.buf, buf.len); -- 2.11.0.157.gd943d85