cat >> "$HOOK" <<'EOF'
if test "$2" = commit; then
- source=$(git-rev-parse "$3")
+ source=$(git rev-parse "$3")
else
source=${2-default}
fi
'
+test_expect_success 'with hook (merge)' '
+
+ head=`git rev-parse HEAD` &&
+ git checkout -b other HEAD@{1} &&
+ echo "more" >> file &&
+ git add file &&
+ git commit -m other &&
+ git checkout - &&
+ git merge other &&
+ test "`git log -1 --pretty=format:%s`" = merge
+'
+
cat > "$HOOK" <<'EOF'
#!/bin/sh
exit 1