[Git] Store Subject in GitCommit.
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Wed, 11 May 2011 16:30:33 +0000 (20:30 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Thu, 12 May 2011 07:39:38 +0000 (11:39 +0400)
plugins/git4idea/src/git4idea/history/GitHistoryUtils.java
plugins/git4idea/src/git4idea/history/browser/GitCommit.java
plugins/git4idea/src/git4idea/history/wholeTree/DetailsLoaderImpl.java

index 9b9ebca04d646f1a933d2efa43f0eff8cf8b488d..5760d3b9fd28567a4989ea5c7e1bd0ead6a8d169 100644 (file)
@@ -502,7 +502,7 @@ public class GitHistoryUtils {
     final String s = parseRefs(refs, currentRefs, locals, remotes, tags);
     gitCommit = new GitCommit(AbstractHash.create(record.getShortHash()), new SHAHash(record.getHash()), record.getAuthorName(),
                                       record.getCommitterName(),
-                                      record.getDate(), record.getFullMessage(),
+                                      record.getDate(), record.getSubject(), record.getFullMessage(),
                                       new HashSet<String>(Arrays.asList(record.getParentsShortHashes())), record.getFilePaths(root),
                                       record.getAuthorEmail(),
                                       record.getCommitterEmail(), tags, locals, remotes,
index 71f2af4485c73458bf22bf136dcb59c4f17dc357..8ecc14275459f6e01868f4c01673634dda75237e 100644 (file)
@@ -31,6 +31,7 @@ public class GitCommit {
   private final SHAHash myHash;
   private final String myAuthor;
   private final String myCommitter;
+  private final String mySubject;
   private final String myDescription;
   private final Date myDate;
 
@@ -60,6 +61,7 @@ public class GitCommit {
                    final String author,
                    final String committer,
                    final Date date,
+                   final String subject,
                    final String description,
                    final Set<String> parentsHashes,
                    final List<FilePath> pathsList,
@@ -74,6 +76,7 @@ public class GitCommit {
     myAuthor = author;
     myCommitter = committer;
     myDate = date;
+    mySubject = subject;
     myDescription = description;
     myHash = hash;
     myParentsHashes = parentsHashes;
@@ -223,4 +226,8 @@ public class GitCommit {
       }
     });
   }
+
+  public String getSubject() {
+    return mySubject;
+  }
 }
index 0293f3462cb0562a1b1f05f0775fa0c70dd783e5..a3fbe82972d132e512f1cdf2b48af19766414580 100644 (file)
@@ -194,7 +194,7 @@ public class DetailsLoaderImpl implements DetailsLoader {
 
     private GitCommit createNotLoadedCommit(AbstractHash shortHash) {
       final String notKnown = "Can not load";
-      return new GitCommit(shortHash, SHAHash.emulate(shortHash), notKnown, notKnown, new Date(0),
+      return new GitCommit(shortHash, SHAHash.emulate(shortHash), notKnown, notKnown, new Date(0), notKnown,
                               "Can not load details", Collections.<String>emptySet(), Collections.<FilePath>emptyList(), notKnown,
                               notKnown, Collections.<String>emptyList(), Collections.<String>emptyList(), Collections.<String>emptyList(),
                               Collections.<Change>emptyList(), 0);