Skip to content

Commit 224bf77

Browse files
committed
Don't log any error on non VCS folder
The error message is useless and confusing. When this project is running under a path that not under VCS, no branch whitelist/blacklist would apply. This is a first step to reduce noise, in the future the branch filtering could use parent's git folder.
1 parent 7da69d8 commit 224bf77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/config/branch_config.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defmodule GitHooks.Config.BranchConfig do
1010
def current_branch do
1111
current_branch_fn =
1212
Application.get_env(:git_hooks, :current_branch_fn, fn ->
13-
System.cmd("git", ["rev-parse", "--abbrev-ref", "HEAD"])
13+
System.cmd("git", ["rev-parse", "--abbrev-ref", "HEAD"], stderr_to_stdout: true)
1414
end)
1515

1616
current_branch_fn.()

0 commit comments

Comments
 (0)