Show current branch in snip single

Reset branch automatically if trying to commit detached
This commit is contained in:
Tim
2023-04-05 22:58:58 +02:00
parent 4e56fed76d
commit 1f464220ee
3 changed files with 13 additions and 3 deletions

View File

@ -35,10 +35,11 @@ class SnipController extends AbstractController
public function single(Snip $snip): Response
{
$this->denyAccessUnlessGranted(SnipVoter::VIEW, $snip);
$snipService = $this->snipServiceFactory->create($snip);
return $this->render('snip/single.html.twig', [
'snip' => $snip,
'content' => $this->snipServiceFactory->create($snip)->get(),
'content' => $snipService->get(),
'branch' => $snipService->getRepo()->getCurrentBranchName(),
]);
}