Higher-level patch workflow operations that compose Git.format_patch/1,
Git.apply_patch/1, and Git.am/1.
All functions accept an optional keyword list. Use :config to specify the
repository via a Git.Config struct; when omitted a default config is built
from the environment.
Summary
Functions
Applies a patch file to the working tree.
Applies mailbox-formatted patches (git am).
Checks whether a patch applies cleanly without actually applying it.
Creates patch files from commits starting at a ref.
Functions
Applies a patch file to the working tree.
Delegates to Git.apply_patch/1.
Options
:config- aGit.Configstruct
Examples
{:ok, :done} = Git.Patch.apply("0001-fix.patch")
Applies mailbox-formatted patches (git am).
Delegates to Git.am/1.
Options
:config- aGit.Configstruct
Examples
{:ok, :done} = Git.Patch.apply_mailbox(["0001-fix.patch"])
Checks whether a patch applies cleanly without actually applying it.
Uses Git.apply_patch/1 with the :check option.
Options
:config- aGit.Configstruct
Examples
{:ok, _output} = Git.Patch.check("0001-fix.patch")
Creates patch files from commits starting at a ref.
Delegates to Git.format_patch/1.
Options
:config- aGit.Configstruct:output_directory- directory to write patch files to
Examples
{:ok, files} = Git.Patch.create("HEAD~3")
{:ok, files} = Git.Patch.create("HEAD~1", output_directory: "/tmp/patches")