Skip to contentSkip to conversation

Accept absolute IdentityFile paths in ssh config

PATCH New Robin Rosenberg 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Accept absolute IdentityFile paths in ssh config

Don't prepend the home directory to absolute paths

---
 .../org/spearce/jgit/transport/OpenSshConfig.java  |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
org.spearce.jgit/src/org/spearce/jgit/transport/OpenSshConfig.java +3 -1
index 9ad19e7..a6849c6 100644
@@ -246,10 +246,12 @@ private static String dequote(final String value) {
 			return value.substring(1, value.length() - 2);
 		return value;
 	}
-
 	private File toFile(final String path) {
 		if (path.startsWith("~/"))
 			return new File(home, path.substring(2));
+		File ret = new File(path);
+		if (ret.isAbsolute())
+			return ret;
 		return new File(home, path);
 	}
 
Signature · 1 line
1.6.0.rc2.35.g04c6e9