@@ -23,7 +23,7 @@ var os = require('os');
2323var gitTools = require ( "./git" ) ;
2424var util = require ( "../util" ) ;
2525var defaultFileSet = require ( "./defaultFileSet" ) ;
26-
26+ var sshKeys = require ( "../sshkeys" ) ;
2727var settings ;
2828var runtime ;
2929var log ;
@@ -645,7 +645,7 @@ Project.prototype.updateRemote = function(user,remote,options) {
645645 if ( options . auth ) {
646646 var url = this . remotes [ remote ] . fetch ;
647647 if ( options . auth . keyFile ) {
648- options . auth . key_path = fspath . join ( projectsDir , ".sshkeys" , ( ( username === '_' ) ? '__default' : username ) + '_' + options . auth . keyFile ) ;
648+ options . auth . key_path = sshKeys . getPrivateKeyPath ( username , options . auth . keyFile ) ;
649649 }
650650 authCache . set ( this . name , url , username , options . auth ) ;
651651 }
@@ -870,10 +870,9 @@ function createProject(user, metadata) {
870870 ) ;
871871 auth = authCache . get ( project , originRemote . url , username ) ;
872872 }
873- else if ( originRemote . hasOwnProperty ( "key_file" ) && originRemote . hasOwnProperty ( "passphrase" ) ) {
874- var key_file_name = ( username === '_' ) ? '__default' + '_' + originRemote . key_file : username + '_' + originRemote . key_file ;
873+ else if ( originRemote . hasOwnProperty ( "keyFile" ) && originRemote . hasOwnProperty ( "passphrase" ) ) {
875874 authCache . set ( project , originRemote . url , username , { // TODO: hardcoded remote name
876- key_path : fspath . join ( projectsDir , ".sshkeys" , key_file_name ) ,
875+ key_path : sshKeys . getPrivateKeyPath ( username , originRemote . keyFile ) ,
877876 passphrase : originRemote . passphrase
878877 }
879878 ) ;
0 commit comments