Commit 3622c45ae485e31f85fe4f500128e0a8141b7328

Thomas de Grivel 2022-01-13T11:16:53

fix repository show

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/kmxgit_web/controllers/repository_controller.ex b/lib/kmxgit_web/controllers/repository_controller.ex
index bacf007..cd4ba57 100644
--- a/lib/kmxgit_web/controllers/repository_controller.ex
+++ b/lib/kmxgit_web/controllers/repository_controller.ex
@@ -348,7 +348,7 @@ defmodule KmxgitWeb.RepositoryController do
   defp show_op(conn, :tree, branch, git, org, path, repo, user) do
     conn
     |> assign(:branch, branch)
-    |> assign(:branch_url, Routes.repository_path(conn, :show, Repository.owner_slug(repo), Repository.splat(repo, ["_tree", branch] ++ (if path, do: String.split(path, "/"), else: []))))
+    |> assign(:branch_url, branch && Routes.repository_path(conn, :show, Repository.owner_slug(repo), Repository.splat(repo, ["_tree", branch] ++ (if path, do: String.split(path, "/"), else: []))))
     |> assign_current_organisation(org)
     |> assign(:current_repository, repo)
     |> assign(:git, git)