@@ -8,7 +8,6 @@ import gitbucket.core.controller.ControllerBase
88import gitbucket .core .service .AccountService
99import gitbucket .core .service .RepositoryService .RepositoryInfo
1010import gitbucket .core .util ._
11- import gitbucket .core .util .SyntaxSugars ._
1211import gitbucket .core .util .Implicits ._
1312import gitbucket .core .view .helpers ._
1413
@@ -194,9 +193,7 @@ trait GistControllerBase extends ControllerBase {
194193 JGitUtil .getCommitLog(git, " master" ) match {
195194 case Right ((revisions, hasNext)) => {
196195 val commits = revisions.map { revision =>
197- defining(JGitUtil .getRevCommitFromId(git, git.getRepository.resolve(revision.id))){ revCommit =>
198- (revision, JGitUtil .getDiffs(git, None , revision.id, true , false ))
199- }
196+ (revision, JGitUtil .getDiffs(git, None , revision.id, true , false ))
200197 }
201198
202199 val gist = getGist(userName, repoName).get
@@ -228,9 +225,8 @@ trait GistControllerBase extends ControllerBase {
228225
229226 if (gist.mode == " PUBLIC" || context.loginAccount.exists(x => x.isAdmin || x.userName == userName)){
230227 JGitUtil .getFileList(git, revision, " ." ).find(_.name == fileName).map { file =>
231- defining(JGitUtil .getContentFromId(git, file.id, false ).get){ bytes =>
232- RawData (FileUtil .getMimeType(file.name, bytes), bytes)
233- }
228+ val bytes = JGitUtil .getContentFromId(git, file.id, false ).get
229+ RawData (FileUtil .getMimeType(file.name, bytes), bytes)
234230 } getOrElse NotFound ()
235231 } else Unauthorized ()
236232 }
0 commit comments