kjkmadness 2014-02-07
code: fix a bug in GitRepository#getPatch(String)
RevCommit object should be parsed to get RevTree object.
this is caused by 4544c08.
@965509e2d3e7e3770ef4abf78431eee1a60c2547
app/playRepository/GitRepository.java
--- app/playRepository/GitRepository.java
+++ app/playRepository/GitRepository.java
@@ -594,7 +594,7 @@
 
         RevCommit parent = null;
         if (commit.getParentCount() > 0) {
-            parent = commit.getParent(0);
+            parent = parseCommit(commit.getParent(0));
         }
 
         return getPatch(parent, commit);
@@ -1814,6 +1814,13 @@
      */
     private RevCommit getRevCommit(String revstr) throws IOException {
         ObjectId objectId = getObjectId(revstr);
+        return parseCommit(objectId);
+    }
+
+    /*
+     * AnyObjectId 를 이용해서 RevCommit 객체를 얻는다
+     */
+    private RevCommit parseCommit(AnyObjectId objectId) throws IOException {
         if (objectId == null) {
             return null;
         }
Add a comment
List