security: ~
fixes:
- Repository mailing lists could not be reset from the Edit Repository page (issue-399)
+ - Fix intermittent NPE in determining commit date in RefModel (issue-401)
- Fix closing ticket on push by parsing commit messages for closes|fixes (issue-404)
- Ensure the Lucene ticket index is updated on repository deletion.
changes:
import org.eclipse.jgit.revwalk.RevObject;\r
import org.eclipse.jgit.revwalk.RevTag;\r
\r
+import com.gitblit.utils.JGitUtils;\r
+\r
/**\r
* RefModel is a serializable model class that represents a tag or branch and\r
* includes the referenced object.\r
if (referencedObject != null) {\r
if (referencedObject instanceof RevTag) {\r
RevTag tag = (RevTag) referencedObject;\r
- if (tag.getTaggerIdent() != null) {\r
- date = tag.getTaggerIdent().getWhen();\r
+ PersonIdent tagger = tag.getTaggerIdent();\r
+ if (tagger != null) {\r
+ date = tagger.getWhen();\r
}\r
} else if (referencedObject instanceof RevCommit) {\r
- date = ((RevCommit) referencedObject).getCommitterIdent().getWhen();\r
+ RevCommit commit = (RevCommit) referencedObject;\r
+ PersonIdent committer = commit.getCommitterIdent();\r
+ if (committer != null) {\r
+ date = committer.getWhen();\r
+ } else {\r
+ date = JGitUtils.getCommitDate(commit);\r
+ }\r
}\r
}\r
return date;\r