From da8afbc2b9525d99efc44ab8edbd16253828d641 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sun, 6 May 2007 22:40:50 +0000 Subject: [PATCH] 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 --- .../main/java/hudson/scm/SubversionSCM.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/hudson/scm/SubversionSCM.java b/core/src/main/java/hudson/scm/SubversionSCM.java index e73c5117b4..473956d8af 100644 --- a/core/src/main/java/hudson/scm/SubversionSCM.java +++ b/core/src/main/java/hudson/scm/SubversionSCM.java @@ -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 {