Why is TreeWalk.forPath(...) returning null

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux