Call the hooks explicitly on a per-action basis, with positional
arguments that are relevant for the action at hand.
diff --git a/git-flow b/git-flow
index ae99749..a03ba1f 100755
--- a/git-flow
+++ b/git-flow
@@ -105,15 +105,8 @@
exit 1
fi
- # Run hook action
- do_hook pre
-
# run the specified action
cmd_$SUBACTION "$@"
-
- # Run hook action
- do_hook post
-
}
main "$@"
diff --git a/git-flow-feature b/git-flow-feature
index 726b4ae..f362f08 100644
--- a/git-flow-feature
+++ b/git-flow-feature
@@ -494,6 +494,8 @@
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 @@
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"
}