Tinfoil.Homebrew.Git behaviour (tinfoil v0.2.22)

Copy Markdown View Source

Thin wrapper around the subset of git commands Tinfoil.Homebrew needs. Kept behind a behaviour so tests can swap in a stub module without touching the real filesystem or network.

Summary

Callbacks

add(dir, relative_path)

@callback add(dir :: Path.t(), relative_path :: String.t()) :: :ok

clone(url, dir)

@callback clone(url :: String.t(), dir :: Path.t()) :: :ok | {:error, term()}

commit(dir, message)

@callback commit(dir :: Path.t(), message :: String.t()) ::
  {:ok, String.t()} | {:error, term()}

config_identity(dir, name, email)

@callback config_identity(dir :: Path.t(), name :: String.t(), email :: String.t()) :: :ok

push(dir)

@callback push(dir :: Path.t()) :: :ok | {:error, term()}

staged_changes?(dir)

@callback staged_changes?(dir :: Path.t()) :: boolean()