Commit ad6c1081f110b57f2124a7089d77fbe0344123e7

Thomas de Grivel 2022-01-24T15:22:15

fix repository show

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/lib/kmxgit/git_manager.ex b/lib/kmxgit/git_manager.ex
index 7829128..ba86a1d 100644
--- a/lib/kmxgit/git_manager.ex
+++ b/lib/kmxgit/git_manager.ex
@@ -198,7 +198,8 @@ defmodule Kmxgit.GitManager do
     end
   end
 
-  defp ok_hd({:ok, list}), do: {:ok, hd(list)}
+  defp ok_hd({:ok, [first | _]}), do: {:ok, first}
+  defp ok_hd({:ok, []}), do: {:ok, nil}
   defp ok_hd(x), do: x
 
   def log1(repo, tree \\ nil) do