Behavior of JGit regarding links? [message #1828094] |
Mon, 01 June 2020 12:51 |
Olivier Cailloux Messages: 43 Registered: July 2009 |
Member |
|
|
JGit supports symbolic links, in the sense that I can ask it whether a file is a symbolic link. That's great! And it raises a few questions for which I couldn't find answers in the documentation.
I wonder if TreeWalk#forPath is supposed (by contract) to follow links, and if this behavior can be explicitly enabled or disabled? (I found WorkingTreeOptions#getSymLinks, but the relationship with the above method and what this option does exactly is unclear to me.)
Relatedly, I wonder if I can detect whether a path uses a symbolic link? And can I obtain easily the target path?
For example, given the path mylink/somefile, where mylink is a link to myfolder/mysubfolder, I know how to obtain from JGit the information that mylink is a link; but is there an easy way to obtain the information that there is a link somewhere in the path "mylink/somefile" (without having to parse and check myself each folder name included in the path), and to directly obtain the information that this links to "myfolder/mysubfolder/somefile" (without having to reconstruct this from the link pieces included in the path)?
|
|
|
Powered by
FUDForum. Page generated in 0.02709 seconds