Skip to content

Commit 602015e

Browse files
Eygene Ryabinkinspearce
authored andcommitted
git-svn: respect Subversion's [auth] section configuration values
Parameters 'store-passwords' and 'store-auth-creds' from Subversion's configuration (~/.subversion/config) were not respected. This was fixed: the default values for these parameters are set to 'yes' to follow Subversion behaviour. Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent 24ccd8b commit 602015e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

git-svn.perl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3065,6 +3065,29 @@ sub new {
30653065
my ($baton, $callbacks) = SVN::Core::auth_open_helper(_auth_providers);
30663066
my $config = SVN::Core::config_get_config($config_dir);
30673067
$RA = undef;
3068+
my $dont_store_passwords = 1;
3069+
my $conf_t = ${$config}{'config'};
3070+
{
3071+
# The usage of $SVN::_Core::SVN_CONFIG_* variables
3072+
# produces warnings that variables are used only once.
3073+
# I had not found the better way to shut them up, so
3074+
# warnings are disabled in this block.
3075+
no warnings;
3076+
if (SVN::_Core::svn_config_get_bool($conf_t,
3077+
$SVN::_Core::SVN_CONFIG_SECTION_AUTH,
3078+
$SVN::_Core::SVN_CONFIG_OPTION_STORE_PASSWORDS,
3079+
1) == 0) {
3080+
SVN::_Core::svn_auth_set_parameter($baton,
3081+
$SVN::_Core::SVN_AUTH_PARAM_DONT_STORE_PASSWORDS,
3082+
bless (\$dont_store_passwords, "_p_void"));
3083+
}
3084+
if (SVN::_Core::svn_config_get_bool($conf_t,
3085+
$SVN::_Core::SVN_CONFIG_SECTION_AUTH,
3086+
$SVN::_Core::SVN_CONFIG_OPTION_STORE_AUTH_CREDS,
3087+
1) == 0) {
3088+
$Git::SVN::Prompt::_no_auth_cache = 1;
3089+
}
3090+
}
30683091
my $self = SVN::Ra->new(url => $url, auth => $baton,
30693092
config => $config,
30703093
pool => SVN::Pool->new,

0 commit comments

Comments
 (0)