author | Arnout Engelen <arnouten@bzzt.net> | |
Sat, 18 Dec 2010 21:28:00 +0000 (22:28 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 22 Dec 2010 03:51:17 +0000 (19:51 -0800) | ||
commit | 6cf6bb3e47ac2f667fa0b27a4222e903ff6fb77c | |
tree | 6f85fb8abadf0e819712c74361b52852858d543a | tree | snapshot |
parent | 853563d7344ee532aa56f8a9aabcfdfb5c4fe2c3 | commit | diff |
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>
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 | diff | blob | history | |
t/t0070-fundamental.sh | diff | blob | history | |
test-mktemp.c | [new file with mode: 0644] | blob |
wrapper.c | diff | blob | history |