mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 21:45:50 +01:00
Add the commit link to refs comment.
This commit is contained in:
@@ -149,7 +149,7 @@ class CommitLogHook(owner: String, repository: String, userName: String, baseURL
|
|||||||
"(^|\\W)#(\\d+)(\\W|$)".r.findAllIn(commit.fullMessage).matchData.foreach { matchData =>
|
"(^|\\W)#(\\d+)(\\W|$)".r.findAllIn(commit.fullMessage).matchData.foreach { matchData =>
|
||||||
val issueId = matchData.group(2)
|
val issueId = matchData.group(2)
|
||||||
if(getAccountByUserName(commit.committer).isDefined && getIssue(owner, repository, issueId).isDefined){
|
if(getAccountByUserName(commit.committer).isDefined && getIssue(owner, repository, issueId).isDefined){
|
||||||
createComment(owner, repository, commit.committer, issueId.toInt, commit.fullMessage, "commit")
|
createComment(owner, repository, commit.committer, issueId.toInt, commit.id + " " + commit.fullMessage, "commit")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,14 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-content"class="issue-content" id="commentContent-@comment.commentId">
|
<div class="box-content"class="issue-content" id="commentContent-@comment.commentId">
|
||||||
@markdown(comment.content, repository, false, true)
|
@if(comment.action == "commit" && comment.content.split(" ").last.matches("[a-f0-9]{40}")){
|
||||||
|
@defining(comment.content.substring(comment.content.length - 40)){ id =>
|
||||||
|
<div class="pull-right"><a href="@path/@repository.owner/@repository.name/commit/@id" class="monospace">@id.substring(0, 7)</a></div>
|
||||||
|
@markdown(comment.content.substring(0, comment.content.length - 41), repository, false, true)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
@markdown(comment.content, repository, false, true)
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user