forked from gitea/gitea
Make code cleaner
Signed-off-by: Gary Kim <gary@garykim.dev>
This commit is contained in:
parent
d7788bff7d
commit
582a180621
|
@ -662,10 +662,7 @@ func sha1CurrentPatternProcessor(ctx *postProcessCtx, node *html.Node) {
|
||||||
// a commit in the repository before making it a link.
|
// a commit in the repository before making it a link.
|
||||||
if ctx.metas["repoPath"] != "" {
|
if ctx.metas["repoPath"] != "" {
|
||||||
repo, err := git.OpenRepository(ctx.metas["repoPath"])
|
repo, err := git.OpenRepository(ctx.metas["repoPath"])
|
||||||
if err != nil {
|
if err != nil || !repo.IsCommitExist(hash) {
|
||||||
return
|
|
||||||
}
|
|
||||||
if !repo.IsCommitExist(hash) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue