{"thread":{"id":"43387","subject":"Re: [PATCH] Oops, get the commit first, then the tree.","startedAt":"2006-12-03T00:45:45Z","lastAt":"2006-12-03T02:34:07Z","messageCount":2,"participants":["Shawn Pearce","Robin Rosenberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"298367","messageId":"200612030145.45567.robin.rosenberg@dewire.com","threadId":"43387","inReplyTo":null,"subject":"[PATCH] Oops, get the commit first, then the tree.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2006-12-03T00:45:45Z","receivedAt":"2006-12-03T00:45:45Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"This made the eclipse plugin unable to connect to Git.\n\nSigned-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>\n---\n .../src/org/spearce/jgit/lib/Repository.java       |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java \nb/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\nindex bfdcd3e..2344817 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\n@@ -168,7 +168,8 @@ public class Repository {\n     }\n \n     public Tree mapTree(final String revstr) throws IOException {\n-\tfinal ObjectId id = resolve(revstr);\n+\tCommit commit = mapCommit(revstr);\n+\tfinal ObjectId id = commit.getTreeId();\n \treturn id != null ? mapTree(id) : null;\n     }\n \n-- \n1.4.4.gf05d\n\n"},{"id":"294582","messageId":"20061203023407.GC26668@spearce.org","threadId":"43387","inReplyTo":"200612030145.45567.robin.rosenberg@dewire.com","subject":"Re: [PATCH] Oops, get the commit first, then the tree.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-12-03T02:34:07Z","receivedAt":"2006-12-03T02:34:07Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Robin Rosenberg <robin.rosenberg@dewire.com> wrote:\n> This made the eclipse plugin unable to connect to Git.\n...\n> --- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\n> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java\n> @@ -168,7 +168,8 @@ public class Repository {\n>      }\n>  \n>      public Tree mapTree(final String revstr) throws IOException {\n> -\tfinal ObjectId id = resolve(revstr);\n> +\tCommit commit = mapCommit(revstr);\n> +\tfinal ObjectId id = commit.getTreeId();\n>  \treturn id != null ? mapTree(id) : null;\n\nI don't want to apply the fix above because mapTree(String) should\nbe able to take an arbitrary SHA1 expression and return the Tree\nobject corresponding to that.  Your change only permits commits to\nbe resolved; but if the revstr resolved to a tag we'd need to peel\nback the tag to get to the tree.  Ideally that should be done in\nmapTree(ObjectId), based on the type of thing ObjectId points to.\n\nI think the bug was caused by a recent breakage in Repository.mapTree\n(42691339).  I fixed it in 020e0ee but neglected to push it out.\nActually I'm surprised mapTree(ObjectId) even works before 020e0ee;\nI just don't see how its right...\n\n-- \n"}]}