DORMANTno replies

[JGIT PATCH] Accept absolute IdentityFile paths in ssh config

From: Robin Rosenberg <hidden>
Date: 2016-06-15 22:45:12
Subsystem: the rest · Maintainer: Linus Torvalds

Don't prepend the home directory to absolute paths

Signed-off-by: Robin Rosenberg <redacted>
---
 .../org/spearce/jgit/transport/OpenSshConfig.java  |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/OpenSshConfig.java b/org.spearce.jgit/src/org/spearce/jgit/transport/OpenSshConfig.java
index 9ad19e7..a6849c6 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/OpenSshConfig.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/OpenSshConfig.java
@@ -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);
 	}
 
-- 
1.6.0.rc2.35.g04c6e9
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help