git-svn: use platform specific auth providers

On Linux, this makes authentication using passwords from gnome-keyring and kwallet work (only the former was tested). On Mac OS X, this allows using the OS X Keychain. Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl> Acked-by: Eric Wong <normalperson@yhbt.net>

Matthijs Kooijman committed Apr 26, 2012 at 21:34 UTC 082afee621aeb2d3746c8ae290af98823f981f34
1 file changed +18 -2
git-svn.perl
+18 -2
@@ -5444,7 +5444,7 @@ BEGIN {
5444 }
5445
5446 sub _auth_providers () {
5447 - [
5447 + my @rv = (
5448 SVN::Client::get_simple_provider(),
5449 SVN::Client::get_ssl_server_trust_file_provider(),
5450 SVN::Client::get_simple_prompt_provider(
@@ -5460,7 +5460,23 @@ sub _auth_providers () {
5460 \&Git::SVN::Prompt::ssl_server_trust),
5461 SVN::Client::get_username_prompt_provider(
5462 \&Git::SVN::Prompt::username, 2)
5463 - ]
5463 + );
5464 +
5465 + # earlier 1.6.x versions would segfault, and <= 1.5.x didn't have
5466 + # this function
5467 + if ($SVN::Core::VERSION gt '1.6.12') {
5468 + my $config = SVN::Core::config_get_config($config_dir);
5469 + my ($p, @a);
5470 + # config_get_config returns all config files from
5471 + # ~/.subversion, auth_get_platform_specific_client_providers
5472 + # just wants the config "file".
5473 + @a = ($config->{'config'}, undef);
5474 + $p = SVN::Core::auth_get_platform_specific_client_providers(@a);
5475 + # Insert the return value from
5476 + # auth_get_platform_specific_providers
5477 + unshift @rv, @$p;
5478 + }
5479 + \@rv;
5480 }
5481
5482 sub escape_uri_only {