notes-merge: use O_EXCL to avoid overwriting existing files
authorRené Scharfe <l.s.r@web.de>
Thu, 7 Jul 2016 20:08:30 +0000 (22:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Jul 2016 21:16:26 +0000 (14:16 -0700)
Use the open(2) flag O_EXCL to ensure the file doesn't already exist
instead of (racily) calling stat(2) through file_exists(). While at it
switch to xopen() to reduce code duplication and get more consistent
error messages.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found