diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2008-05-29 18:55:53 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-06-01 01:33:59 +0400 |
commit | ad5fa3cc0e115a8b111868af2f727322feb144cb (patch) | |
tree | 09d7ab5a909bd1cc63e2ce3be8cacf73324fcaf9 /t/t7502-commit.sh | |
parent | c16570c42a748a29031281badd4762dd4e71d3d0 (diff) |
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 <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7502-commit.sh')
-rwxr-xr-x | t/t7502-commit.sh | 14 |
1 files changed, 14 insertions, 0 deletions
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 |