Re: [PATCH v4] commit: check result of resolve_ref_unsafe

2017-10-21 Thread Junio C Hamano
Jeff King writes: >> Hello, >> I think this way is better for user experience: >> * git doesn't crash; >> * warning is shown; >> * commit has been successfully created then it's safe to show a summary >> message >> with already known information and without resolved HEAD. > > I'm on the fence be

Re: [PATCH v4] commit: check result of resolve_ref_unsafe

2017-10-20 Thread Jeff King
On Fri, Oct 20, 2017 at 04:09:30PM +0300, Andrey Okoshkin wrote: > Add check of the resolved HEAD reference while printing of a commit summary. > resolve_ref_unsafe() may return NULL pointer if underlying calls of lstat() or > open() fail in files_read_raw_ref(). > Such situation can be caused by

[PATCH v4] commit: check result of resolve_ref_unsafe

2017-10-20 Thread Andrey Okoshkin
Add check of the resolved HEAD reference while printing of a commit summary. resolve_ref_unsafe() may return NULL pointer if underlying calls of lstat() or open() fail in files_read_raw_ref(). Such situation can be caused by race: file becomes inaccessible to this moment. Signed-off-by: Andrey Oko