Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.

Commit

Permalink
Fix symlink handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
JBYoshi committed Nov 15, 2015
1 parent 4b30ae0 commit 7c04a28
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/main/java/jbyoshi/gitupdate/GitUpdate.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,10 @@ public static void update(Repository repo, Task root) {
if (dir.getName().equals(".git")) {
dir = dir.getParentFile();
}
{
Path path = dir.toPath();
if (Files.isSymbolicLink(path)) {
try {
dir = Files.readSymbolicLink(path).toFile();
} catch (IOException e) {
// Ignore
}
}
try {
dir = dir.toPath().toRealPath().toFile();
} catch (IOException e) {
dir = dir.toPath().normalize().toFile();
}
if (!updated.add(dir)) {
return;
Expand Down

0 comments on commit 7c04a28

Please sign in to comment.