From 6df10358aa7f9c544b188b51d6d1e8b3e66c8a28 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Wed, 10 Mar 2010 21:37:55 +0100 Subject: [git-tools] use mktemp in pre-commit (thanks nn-) --- git-tools/hooks/pre-commit | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'git-tools/hooks') diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit index 4a070d130c..937d2d2dc0 100755 --- a/git-tools/hooks/pre-commit +++ b/git-tools/hooks/pre-commit @@ -28,13 +28,12 @@ IFS=" " for file in $(git diff --cached --name-status $against | grep -v -E '^D' | cut -f2 | grep -E '\.php$') do # store lint result in a temp file - tempfile="/tmp/$(basename $0).$$.tmp" + tempfile=$(mktemp -t "$(basename $0).XXXXXX") if ! php -l "$file" >/dev/null 2>"$tempfile" then error=1 cat "$tempfile" fi - rm -f "$tempfile" done unset IFS -- cgit v1.2.3-18-g5258