sequencer: make file exists check more efficient
authorDenton Liu <liu.denton@gmail.com>
Tue, 7 Apr 2020 14:27:51 +0000 (10:27 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Apr 2020 23:57:30 +0000 (16:57 -0700)
commit5b2f6d9cd50b1c8909326c7175aef288a9915f33
tree17f549a69d3c7744793219a12b7622cf1e1d6fa7
parent65c425a2ec815989994716c81a2307ae5b5645bc
sequencer: make file exists check more efficient

We currently check whether a file exists and return early before reading
the file. Instead of accessing the file twice, always read the file and
check `errno` to see if the file doesn't exist.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c