Commit 359db205 authored by Vincent Driessen's avatar Vincent Driessen

Call the hooks explicitly on a per-action basis, with positional

arguments that are relevant for the action at hand.
parent 203a793f
......@@ -105,15 +105,8 @@ main() {
exit 1
fi
# Run hook action
do_hook pre
# run the specified action
cmd_$SUBACTION "$@"
# Run hook action
do_hook post
}
main "$@"
......@@ -494,6 +494,8 @@ cmd_pull() {
require_clean_working_tree
run_pre_hook "$NAME" "$REMOTE" "$BRANCH"
if git_branch_exists "$BRANCH"; then
# Again, avoid accidental merges
avoid_accidental_cross_branch_action || die
......@@ -509,4 +511,6 @@ cmd_pull() {
git checkout -q "$BRANCH" || die "Checking out new local branch failed."
echo "Created local branch $BRANCH based on $REMOTE's $BRANCH."
fi
run_post_hook "$NAME" "$REMOTE" "$BRANCH"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment