summaryrefslogtreecommitdiff
path: root/t/t7502-commit.sh
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2008-05-29 14:55:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-31 21:33:59 (GMT)
commitad5fa3cc0e115a8b111868af2f727322feb144cb (patch)
tree09d7ab5a909bd1cc63e2ce3be8cacf73324fcaf9 /t/t7502-commit.sh
parentc16570c42a748a29031281badd4762dd4e71d3d0 (diff)
downloadgit-ad5fa3cc0e115a8b111868af2f727322feb144cb.zip
git-ad5fa3cc0e115a8b111868af2f727322feb144cb.tar.gz
git-ad5fa3cc0e115a8b111868af2f727322feb144cb.tar.bz2
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-xt/t7502-commit.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 3531a99..46ec1ce 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