summaryrefslogtreecommitdiff
path: root/pack-write.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2021-08-25 20:14:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-08-25 21:39:06 (GMT)
commita7439d0f9dd291e7cc9e6c2dda19cbfdf09b62ee (patch)
tree2f2d828781a62834225905d4a55cefd28902f33f /pack-write.c
parent225bc32a989d7a22fa6addafd4ce7dcd04675dbf (diff)
downloadgit-a7439d0f9dd291e7cc9e6c2dda19cbfdf09b62ee.zip
git-a7439d0f9dd291e7cc9e6c2dda19cbfdf09b62ee.tar.gz
git-a7439d0f9dd291e7cc9e6c2dda19cbfdf09b62ee.tar.bz2
xopen: explicitly report creation failures
If the flags O_CREAT and O_EXCL are both given then open(2) is supposed to create the file and error out if it already exists. The error message in that case looks like this: fatal: could not open 'foo' for writing: File exists Without further context this is confusing: Why should the existence of the file pose a problem? Isn't that a requirement for writing to it? Add a more specific error message for that case to tell the user that we actually don't expect the file to preexist, so the example becomes: fatal: unable to create 'foo': File exists Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-write.c')
0 files changed, 0 insertions, 0 deletions