Commit 77fd9a6ecf4c8bce21dcc2653a2e37ad046bc89b

Thomas de Grivel 2024-07-18T19:22:14

change release method to different repository full_slug(repo) + "/release".

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/lib/kmxgit_web/controllers/repository_controller.ex b/lib/kmxgit_web/controllers/repository_controller.ex
index 5653624..9fff813 100644
--- a/lib/kmxgit_web/controllers/repository_controller.ex
+++ b/lib/kmxgit_web/controllers/repository_controller.ex
@@ -745,12 +745,12 @@ defmodule KmxgitWeb.RepositoryController do
     git
   end
   defp git_put_release(git = %{valid: true}, repo, tree, conn) do
-    case Git.files(Repository.full_slug(repo), tree, "release/") do
+    case Git.files(Repository.full_slug(repo) + "/release", "master", "release/#{tree}") do
       {:ok, []} -> git
       {:ok, files} ->
         release = files
         |> Enum.map(fn f = %{url: url} ->
-          %{f | url: Routes.repository_path(conn, :show, Repository.owner_slug(repo), Repository.splat(repo) ++ ["_blob", tree | String.split(url, "/")])}
+          %{f | url: Routes.repository_path(conn, :show, Repository.owner_slug(repo), Repository.splat(repo) ++ ["release", "_blob", "master" | String.split(url, "/")])}
         end)
         %{git | release: release}
       {:error, _} -> git