Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/git_ops/git.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule GitOps.Git do
@default_githooks_path ".git/hooks"

@spec init!() :: Git.Repository.t()
def init!() do
def init! do
Git.init!(File.cwd!())
end

Expand Down
11 changes: 6 additions & 5 deletions test/message_hook_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ defmodule GitOps.Mix.Tasks.Test.MessageHookTest do
assert File.exists?(commit_msg_hook_path)
refute File.read!(commit_msg_hook_path) =~ ~S{mix git_ops.check_message "$@"}

assert_raise Mix.Error,
~r/The commit-msg hook `.*` does not call the Conventional Commits message validation task/,
fn ->
MessageHook.run(["--commit-msg-hook-path-override", commit_msg_hook_path])
end
regex =
~r/The commit-msg hook `.*` does not call the Conventional Commits message validation task/

assert_raise Mix.Error, regex, fn ->
MessageHook.run(["--commit-msg-hook-path-override", commit_msg_hook_path])
end

assert File.exists?(commit_msg_hook_path)
assert initial_content == File.read!(commit_msg_hook_path)
Expand Down