]> git.ipfire.org Git - thirdparty/git.git/commit
Improve error messages when temporary file creation fails
authorArnout Engelen <arnouten@bzzt.net>
Sat, 18 Dec 2010 21:28:00 +0000 (22:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 22 Dec 2010 03:51:17 +0000 (19:51 -0800)
commit6cf6bb3e47ac2f667fa0b27a4222e903ff6fb77c
tree6f85fb8abadf0e819712c74361b52852858d543a
parent853563d7344ee532aa56f8a9aabcfdfb5c4fe2c3
Improve error messages when temporary file creation fails

Before, when creating a temporary file failed, a generic 'Unable to create
temporary file' message was printed. In some cases this could lead to
confusion as to which directory should be checked for correct permissions etc.

This patch adds the template for the temporary filename to the error message,
converting it to an absolute path if needed. A test verifies that the template
is indeed printed when pointing to a nonexistent or unwritable directory.

A copy of the original template is made in case mkstemp clears the template.

Signed-off-by: Arnout Engelen <arnouten@bzzt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
t/t0070-fundamental.sh
test-mktemp.c [new file with mode: 0644]
wrapper.c