feat: step 5 claimed done

This commit is contained in:
2026-04-27 22:36:53 +02:00
parent 0e1d8852f7
commit 2f09bf527d
20 changed files with 1740 additions and 115 deletions

View File

@@ -87,6 +87,27 @@ defmodule BDS.Git do
end
end
def get_diff_content(project_id, file_path, opts \\ [])
when is_binary(project_id) and is_binary(file_path) and is_list(opts) do
with {:ok, project_dir} <- project_dir(project_id) do
runner = Keyword.get(opts, :runner, &system_runner/3)
original =
case runner.("git", ["show", "HEAD:#{file_path}"], command_opts(project_dir)) do
{output, 0} -> output
{_output, _status} -> ""
end
modified =
case File.read(Path.join(project_dir, file_path)) do
{:ok, contents} -> contents
{:error, _reason} -> ""
end
{:ok, %{file_path: file_path, original: original, modified: modified}}
end
end
def history(project_id, branch, opts \\ [])
when is_binary(project_id) and is_binary(branch) and is_list(opts) do
with {:ok, project_dir} <- project_dir(project_id),