From ad5fa3cc0e115a8b111868af2f727322feb144cb Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 29 May 2008 16:55:53 +0200 Subject: rollback lock files on more signals than just SIGINT Other signals are also common, for example SIGTERM and SIGHUP. This patch modifies the lock file mechanism to catch more signals. It also modifies http-push.c which was missing SIGTERM. Signed-off-by: Paolo Bonzini Signed-off-by: Junio C Hamano --- t/t7502-commit.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 't/t7502-commit.sh') diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh index 3531a992a9..46ec1ce8aa 100755 --- a/t/t7502-commit.sh +++ b/t/t7502-commit.sh @@ -212,4 +212,18 @@ test_expect_success 'do not fire editor in the presence of conflicts' ' test "`cat .git/result`" = "editor not started" ' +pwd=`pwd` +cat > .git/FAKE_EDITOR << EOF +#! /bin/sh +# kill -TERM command added below. +EOF + +test_expect_success 'a SIGTERM should break locks' ' + echo >>negative && + sh -c '\'' + echo kill -TERM $$ >> .git/FAKE_EDITOR + GIT_EDITOR=.git/FAKE_EDITOR exec git commit -a'\'' && exit 1 # should fail + ! test -f .git/index.lock +' + test_done -- cgit v1.3-5-g9baa