From 9612dd9dc68e232f5e407a18b63f3a4537c3bf51 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Fri, 31 Aug 2007 05:29:10 +0000 Subject: [PATCH] Don't let a task trigger itself when used as the source for an "on" hook (closes #9356) git-svn-id: http://svn.rubyonrails.org/rails/tools/capistrano@7381 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- CHANGELOG | 2 ++ lib/capistrano/callback.rb | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 3af0da76c..4ab100746 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Don't let a task trigger itself when used as the source for an "on" hook [Jamis Buck] + * Avoid using the --password switch with subversion for security purposes [sentinel] * Add version_dir, current_dir, and shared_dir variables for naming the directories used in deployment [drinkingbird] diff --git a/lib/capistrano/callback.rb b/lib/capistrano/callback.rb index f2dfb4884..deba05bc4 100644 --- a/lib/capistrano/callback.rb +++ b/lib/capistrano/callback.rb @@ -37,5 +37,9 @@ def initialize(config, source, options={}) def call config.find_and_execute_task(source) end + + def applies_to?(task) + super && (task.nil? || task.fully_qualified_name != source.to_s) + end end end \ No newline at end of file