fixed #531 "SVN+SSH doesn't work without private key"

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3292 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-05-06 22:40:50 +00:00
1 parent aef102cb72
commit da8afbc2b9
1 file changed
+14 -8
@@ -726,14 +726,20 @@ public class SubversionSCM extends SCM implements Serializable {
// SVNKit wants a key in a file
FileItem item = parser.getFileItem("privateKey");
final File keyFile = File.createTempFile("hudson","key");
if(item!=null)
try {
item.write(keyFile);
} catch (Exception e) {
throw new IOException2(e);
}
final File keyFile;
FileItem item=null;
if(!passwordKind) {
item = parser.getFileItem("privateKey");
keyFile = File.createTempFile("hudson","key");
if(item!=null)
try {
item.write(keyFile);
} catch (Exception e) {
throw new IOException2(e);
}
} else {
keyFile = null;
}
try {