Skip to content
Browse files

Don't send no-auth-cache if no auth credentials are given

git-svn-id: http://svn.rubyonrails.org/rails/branches/capistrano_1-x-stable@6339 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 614152f commit 54cee940d2834f406d960d30193b8e442f55126a @jamis jamis committed Mar 5, 2007
Showing with 15 additions and 2 deletions.
  1. +5 −1 CHANGELOG
  2. +2 −1 lib/capistrano/scm/subversion.rb
  3. +8 −0 test/scm/subversion_test.rb
View
6 CHANGELOG
@@ -1,6 +1,10 @@
+*SVN*
+
+* Don't send no-auth-cache if no auth credentials are given [Jonathan Younger]
+
*1.4.1* (February 24, 2007)
-* Use the no-auth-cache option with subversion so that username/password tokens do not get cached by capistrano usage [jonathan]
+* Use the no-auth-cache option with subversion so that username/password tokens do not get cached by capistrano usage [Jonathan Younger]
* Deprecated upper-cased variables [Jamis Buck]
View
3 lib/capistrano/scm/subversion.rb
@@ -80,7 +80,8 @@ def svn
def authorization
username = configuration[:svn_username] ? "--username #{configuration[:svn_username]}" : ""
password = configuration[:svn_password] ? "--password #{configuration[:svn_password]}" : ""
- "--no-auth-cache #{username} #{password}"
+ no_auth_cache = configuration[:svn_username] || configuration[:svn_password] ? "--no-auth-cache" : ""
+ "#{no_auth_cache} #{username} #{password}"
end
def svn_log(path)
View
8 test/scm/subversion_test.rb
@@ -134,4 +134,12 @@ def test_svn_username
assert_nil @actor.channels.last.sent_data
assert_match %r{/path/to/svn\b.*\bco\b.* --username turtledove}, @actor.command
end
+
+ def test_svn_no_auth_cache
+ @actor.story = []
+ @config[:svn_username] = "turtledove"
+ assert_nothing_raised { @scm.checkout(@actor) }
+ assert_nil @actor.channels.last.sent_data
+ assert_match %r{/path/to/svn\b.*\bco\b.* --no-auth-cache --username turtledove}, @actor.command
+ end
end

0 comments on commit 54cee94

Please sign in to comment.
Something went wrong with that request. Please try again.