exec git init
exec git config user.email "you@example.com"
exec git config user.name "Your Name"
exec lefthook install
exec git add -A
exec git commit -m 'initial'

# Stage first change
exec echo lineStaged
cp stdout a.txt
exec git add -A
exec echo lineUnstaged
cp stdout a.txt

# Change that line in the hook
exec git commit -m 'test'

# Must successfully apply the hook
! grep lineStaged a.txt
grep lineUnstaged a.txt
grep lineNew a.txt
grep lineNew b.txt

-- lefthook.yml --
pre-commit:
  jobs:
    - run: echo "lineNew" >> a.txt
    - run: echo "lineNew" > b.txt

-- a.txt --
line

-- b.txt --
lineCommitted

