Skip to content

Commit

Permalink
Don't send no-auth-cache if no auth credentials are given
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.rubyonrails.org/rails/branches/capistrano_1-x-stable@6339 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jamis committed Mar 5, 2007
1 parent 614152f commit 54cee94
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion 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]

Expand Down
3 changes: 2 additions & 1 deletion lib/capistrano/scm/subversion.rb
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions test/scm/subversion_test.rb
Expand Up @@ -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.