summaryrefslogtreecommitdiff
path: root/rerere.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2017-05-03 10:16:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-26 03:33:56 (GMT)
commite9d983f116c7de43f40a49aae60ebfe107f153ec (patch)
tree2d1b2b10e651eb3dd941a10379719c9abd8ef993 /rerere.c
parent11dc1fcb3fa53f5a46486daa7cb38ed387153f2e (diff)
downloadgit-e9d983f116c7de43f40a49aae60ebfe107f153ec.zip
git-e9d983f116c7de43f40a49aae60ebfe107f153ec.tar.gz
git-e9d983f116c7de43f40a49aae60ebfe107f153ec.tar.bz2
wrapper.c: add and use fopen_or_warn()
When fopen() returns NULL, it could be because the given path does not exist, but it could also be some other errors and the caller has to check. Add a wrapper so we don't have to repeat the same error check everywhere. 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 'rerere.c')
-rw-r--r--rerere.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rerere.c b/rerere.c
index 3bd55ca..971bfed 100644
--- a/rerere.c
+++ b/rerere.c
@@ -200,7 +200,7 @@ static struct rerere_id *new_rerere_id(unsigned char *sha1)
static void read_rr(struct string_list *rr)
{
struct strbuf buf = STRBUF_INIT;
- FILE *in = fopen(git_path_merge_rr(), "r");
+ FILE *in = fopen_or_warn(git_path_merge_rr(), "r");
if (!in)
return;