git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why is TreeWalk.forPath(...) returning null
@ 2008-11-12 22:24 Farrukh Najmi
  2008-11-12 22:42 ` Shawn O. Pearce
  0 siblings, 1 reply; 3+ messages in thread
From: Farrukh Najmi @ 2008-11-12 22:24 UTC (permalink / raw)
  To: git


My "git status" command shows:

# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#    modified:   xml/minDB/SubmitObjectsRequest_CMSScheme.xml

The file above was committed and then modified. I want to use jgit to 
find the comitted version of that file.

When I do the following code I get a null treeWalk? Why is that? What 
should I specify for path instead?

            String path = "xml/minDB/SubmitObjectsRequest_CMSScheme.xml";
            String versionName = Constants.HEAD;

            Commit commit = repository.mapCommit(versionName);

            if (commit == null) {
                log.trace("Did not find Commit. versionName:" + 
versionName);
            } else {
                ObjectId[] ids = {commit.getTree().getId()};
                TreeWalk treeWalk = TreeWalk.forPath(repository, path, ids);
            }

Thanks.

-- 
Regards,
Farrukh Najmi

Web: http://www.wellfleetsoftware.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-12 22:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-12 22:24 Why is TreeWalk.forPath(...) returning null Farrukh Najmi
2008-11-12 22:42 ` Shawn O. Pearce
2008-11-12 22:52   ` Farrukh Najmi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).