Allow git-secret to run from any directory in the work tree

pull/42/merge
Tim Churchard 8 years ago committed by sobolevn
parent c6a13cf405
commit d7be9f92b1
No known key found for this signature in database
GPG Key ID: FF672D568AE3C73E

@ -142,6 +142,12 @@ function _add_ignored_file {
}
function _is_inside_git_tree {
git rev-parse --is-inside-work-tree >/dev/null 2>&1
echo $?
}
# Logic :
function _abort {

@ -4,7 +4,9 @@ set -e
function _check_setup {
# Checking git and secret-plugin setup:
if [[ ! -d ".git" ]] || [[ ! -d ".git/hooks" ]]; then
local is_tree
is_tree=$(_is_inside_git_tree)
if [[ $is_tree != "0" ]]; then
_abort "repository is broken. try running 'git init' or 'git clone'."
fi

Loading…
Cancel
Save