Commit 27fd975cd680bb18ff20dc65e2b298ac65609d22

Thomas de Grivel 2023-11-27T23:25:53

fix empty git repo

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 6b5e1dc..05c251c 100644
--- a/lib/kmxgit_web/controllers/repository_controller.ex
+++ b/lib/kmxgit_web/controllers/repository_controller.ex
@@ -696,8 +696,12 @@ defmodule KmxgitWeb.RepositoryController do
                IO.inspect(err)
                nil
            end
-    %{git | log1: log1}
-    |> git_add_user_email(log1.author_email)
+    if log1 do
+      %{git | log1: log1}
+      |> git_add_user_email(log1.author_email)
+    else
+      git
+    end
   end
   defp git_put_log1(git, _, _, _) do
     git