Permalink
Browse files

bad symbol/string comparison on Git branch name

Fixed a string comparison bug which happens when:

  set :branch, 'production'

is used under Ruby 1.9.1p243. For some reason, the
"revision" variable comes as a symbol and therefore the
string comparison fails and later causes this error:

  lib/capistrano/recipes/deploy/scm/git.rb:232:in `query_revision': Unable to resolve revision for 'production' on repository ''. (RuntimeError)
  • Loading branch information...
1 parent 31e16a1 commit 2c7648f2e3d0c8c0f672530b6fec9b5efceb62c8 @sunaku sunaku committed with leehambley Aug 19, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/capistrano/recipes/deploy/scm/git.rb
View
2 lib/capistrano/recipes/deploy/scm/git.rb
@@ -223,7 +223,7 @@ def query_revision(revision)
newrev = nil
revdata.each_slice(2) do |refs|
rev, ref = *refs
- if ref.sub(/refs\/.*?\//, '').strip == revision
+ if ref.sub(/refs\/.*?\//, '').strip == revision.to_s
newrev = rev
break
end

0 comments on commit 2c7648f

Please sign in to comment.