| Summary: | Repository#resolve() methods returns invalid objectIds when using params like refs/heads/0.1-0^{tree}:admin/appdemo/Main.tpl | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Technology] JGit | Reporter: | Daniel Pacak <pacak.daniel> | ||||
| Component: | JGit | Assignee: | Kevin Sawicki <kevin> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | ||||||
| Version: | 1.2 | ||||||
| Target Milestone: | 1.3-M1 | ||||||
| Hardware: | All | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Proposed fix pushed to: http://egit.eclipse.org/r/#change,4956 Merged into master as commit 03b5416a35ad78773fb0a97a98686fec18c0c05e |
Created attachment 209322 [details] Test Git repo and java unit test showing a bug. I found the case when the org.eclipse.jgit.lib.Repository#resolve() methods returns invalid objectId(s). Attached you can find a small Git repository and a maven project with the unit test which demonstrates invalid behavior. Note that in the test repo I have a branch named '0.1-0' and I want to retrieve the content of a file from this branch under the admin/appdemo/Main.tpl path. It means that somewhere in my code I'm calling: org.eclipse.jgit.lib.Repository#resolve("refs/heads/0.1-0^{tree}:admin/appdemo/Main.tpl"); which returns pointer to a tree object instead of a blob with Main.tpl content!! When using other Git clients (Eclipse Git plugin or command line git-scm) I can retrieve the content of all files without any problems. What is more, when I'm using a bit different API the problem disappears (there are two methods in my Java class which are supposed to do exactly the same thing but are using slightly different API: RepositoryManager#getResourceAsString() and RepositoryManager#getResourceAsString2()). Could you take a look at that issue please? Thanks in advance, Daniel Pacak