Commit facbe660b87245955fa9a26f18678235b5daa9d3

Thomas de Grivel 2021-12-13T17:49:43

fix branch url

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 5a799d4..7e08a64 100644
--- a/lib/kmxgit_web/controllers/repository_controller.ex
+++ b/lib/kmxgit_web/controllers/repository_controller.ex
@@ -112,7 +112,7 @@ defmodule KmxgitWeb.RepositoryController do
       if git.valid do
         conn
         |> assign(:branch, branch1)
-        |> assign(:branch_url, Routes.repository_path(conn, :show, Repository.owner_slug(repo), Repository.splat(repo) ++ ["_branch", branch1]))
+        |> assign(:branch_url, Routes.repository_path(conn, :show, Repository.owner_slug(repo), Repository.splat(repo, if branch1 do ["_branch", branch1] else [] end)))
         |> assign_current_organisation(org)
         |> assign(:current_repository, repo)
         |> assign(:git, git)