Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Bug in TreeWalk.forPath (?)

On Fri, Jan 28, 2011 at 00:24, Georgios Gousios <gousiosg@xxxxxxx> wrote:
>>>
>>>        RevCommit c =
>>> rw.parseCommit(local.resolve("b18bca3b853dee6a7bc86f09921aa3b1ee3f3d7b"));
>>>        TreeWalk tw = TreeWalk.forPath(local, "tests/files/working",
>>> c.getTree());

Did you get the path of the returned TreeWalk?

I'll bet its the first file of the test/files/working subdirectory.
Because the TreeWalk was setRecursive(true) and a PathFilter was
installed for tests/files/working, TreeWalk stopped on the first file
that matched that name, or that was in a subdirectory that matched
that name.  Its not looking at subdirectories at all.

Basically, forPath can only be used on files.  If you use it on a
directory path, its comes back with bad results.  Like this.

-- 
Shawn.


Back to the top