git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[JGIT PATCH] Accept absolute IdentityFile paths in ssh config

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Aug 21, 2008, 23:07 UTC
Message-ID
<200808220107.04568.robin.rosenberg.lists@dewire.com>
Don't prepend the home directory to absolute paths
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 .../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
Message 1 of 1 in “Accept absolute IdentityFile paths in ssh config”
  1. Accept absolute IdentityFile paths in ssh configRobin Rosenberg, Aug 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.