Re: [PATCH v2] rollback lock files on more signals than just SIGINT
- From
Mike Ralphson <mike.ralphson@gmail.com>
- Date
- Jun 4, 2008, 11:40 UTC
- Message-ID
- <e2b179460806040440m29f2326ek3757660646686623@mail.gmail.com>
- In-Reply-To
- <E1K1jnV-0007HC-Om@fencepost.gnu.org>
2008/5/29 Paolo Bonzini <bonzini@gnu.org>:
Show 28 quoted lines
> > 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. > > 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
This addition to the testsuite breaks it on AIX with the default sh (ksh). Replacing the explicit sh -c with $SHELL_PATH -c fixes it for me (as I have SHELL_PATH pointing to bash). If that's acceptable I can post a patch if necessary.
Happy to test any other suggested fixes.
Mike