diff options
author | Shawn Pearce <spearce@spearce.org> | 2010-12-15 18:55:59 -0500 |
---|---|---|
committer | Code Review <codereview-daemon@eclipse.org> | 2010-12-15 18:55:59 -0500 |
commit | c19093bbad098fb268e0889cff1a782272eb9f5d (patch) | |
tree | 9918549c7f8db2e24bdc45760c2d354c04b966f2 /org.eclipse.jgit | |
parent | 6f3b4d5d041b166499e3be241feb62d01fb1a0b2 (diff) | |
parent | bab053afddbbc26203da54af2dface6ed657f116 (diff) | |
download | jgit-c19093bbad098fb268e0889cff1a782272eb9f5d.tar.gz jgit-c19093bbad098fb268e0889cff1a782272eb9f5d.zip |
Merge "Do not rely on filemode differences in case of symbolic links"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java index 6365c119c2..69d9b22d1e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java @@ -556,15 +556,19 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { // bitwise presentation of modeDiff we'll have a '1' when the two modes // differ at this position. int modeDiff = getEntryRawMode() ^ entry.getRawMode(); - // Ignore the executable file bits if checkFilemode tells me to do so. - // Ignoring is done by setting the bits representing a EXECUTABLE_FILE - // to '0' in modeDiff - if (!state.options.isFileMode()) - modeDiff &= ~FileMode.EXECUTABLE_FILE.getBits(); - if (modeDiff != 0) - // Report a modification if the modes still (after potentially - // ignoring EXECUTABLE_FILE bits) differ - return true; + + // Do not rely on filemode differences in case of symbolic links + if (modeDiff != 0 && !FileMode.SYMLINK.equals(entry.getRawMode())) { + // Ignore the executable file bits if WorkingTreeOptions tell me to + // do so. Ignoring is done by setting the bits representing a + // EXECUTABLE_FILE to '0' in modeDiff + if (!state.options.isFileMode()) + modeDiff &= ~FileMode.EXECUTABLE_FILE.getBits(); + if (modeDiff != 0) + // Report a modification if the modes still (after potentially + // ignoring EXECUTABLE_FILE bits) differ + return true; + } // Git under windows only stores seconds so we round the timestamp // Java gives us if it looks like the timestamp in index is seconds |