From 3015fa5846c19e79f99c1d6a49fd2510ed9291b8 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Wed, 25 Jun 2008 20:35:13 +0200 Subject: Fix use of "perl -i" on Windows The perldiag(1) has following to say about this: "Can't do inplace edit without backup" (F) You're on a system such as MS-DOS that gets confused if you try reading from a deleted (but still opened) file. You have to say -i.bak, or some such. Signed-off-by: Alex Riesen Signed-off-by: Junio C Hamano --- templates/hooks--prepare-commit-msg.sample | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'templates/hooks--prepare-commit-msg.sample') diff --git a/templates/hooks--prepare-commit-msg.sample b/templates/hooks--prepare-commit-msg.sample index aa42acfd68..365242499d 100755 --- a/templates/hooks--prepare-commit-msg.sample +++ b/templates/hooks--prepare-commit-msg.sample @@ -22,10 +22,10 @@ case "$2,$3" in merge,) - perl -i -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; # ,|template,) -# perl -i -pe ' +# perl -i.bak -pe ' # print "\n" . `git diff --cached --name-status -r` # if /^#/ && $first++ == 0' "$1" ;; -- cgit v1.3