Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update core/src/main/java/hudson/model/Run.java
Handling NTFS symlinks introduced via Util.resolveSymlink.
JENKINS-15587
Also probably culprit for JENKINS-13972
  • Loading branch information
aleksas committed Jan 23, 2013
1 parent 77b49f5 commit 3d85071
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/hudson/model/Run.java
Expand Up @@ -340,6 +340,11 @@ public void addAction(Action a) {

/*package*/ static long parseTimestampFromBuildDir(File buildDir) throws IOException {
try {
// "Utils.resolveSymlink(file)" does with NTFS symlinks what "file.getCanonicalFile()" is unable to
// leaving original getCanonicalFile in case it is there for any additional reason
if(Util.isSymlink(buildDir)) {
buildDir = new File(Util.resolveSymlink(buildDir));
}
// canonicalization to ensure we are looking at the ID in the directory name
// as opposed to build numbers which are used in symlinks
return ID_FORMATTER.get().parse(buildDir.getCanonicalFile().getName()).getTime();
Expand Down

0 comments on commit 3d85071

Please sign in to comment.