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() { ...@@ -105,15 +105,8 @@ main() {
exit 1 exit 1
fi fi
# Run hook action
do_hook pre
# run the specified action # run the specified action
cmd_$SUBACTION "$@" cmd_$SUBACTION "$@"
# Run hook action
do_hook post
} }
main "$@" main "$@"
...@@ -494,6 +494,8 @@ cmd_pull() { ...@@ -494,6 +494,8 @@ cmd_pull() {
require_clean_working_tree require_clean_working_tree
run_pre_hook "$NAME" "$REMOTE" "$BRANCH"
if git_branch_exists "$BRANCH"; then if git_branch_exists "$BRANCH"; then
# Again, avoid accidental merges # Again, avoid accidental merges
avoid_accidental_cross_branch_action || die avoid_accidental_cross_branch_action || die
...@@ -509,4 +511,6 @@ cmd_pull() { ...@@ -509,4 +511,6 @@ cmd_pull() {
git checkout -q "$BRANCH" || die "Checking out new local branch failed." git checkout -q "$BRANCH" || die "Checking out new local branch failed."
echo "Created local branch $BRANCH based on $REMOTE's $BRANCH." echo "Created local branch $BRANCH based on $REMOTE's $BRANCH."
fi 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