Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Quick question about WorkingTreeIterator::contentCheck

I was just looking at the source for
org.eclipse.jgit.treewalk.WorkingTreeIterator (via the github mirror),
and I noticed something I thought was strange in function contentCheck
(https://github.com/eclipse/jgit/blob/04e16afb05912f3a163d8cda3560a5b2f1ea997f/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java#L1057-L1060)
        if (mode == FileMode.SYMLINK.getBits()) {
            return !new File(readSymlinkTarget(current())).equals(
                    new File(readContentAsNormalizedString(entry, reader)));
        }
The functions readSymlinkTarget and readContentAsNormalizedString both
return strings which are the contents of their respective files. But
the java.io.File constructor should be taking a path name argument.
Have I understood correctly?
Is it right to construct File objects like this?
Yours,
Peter


Back to the top