Merge pull request #56 from timchurchard/any_work_tree

Allow git-secret to run from any directory in the work tree
pull/62/head
Sobolev Nikita 8 years ago committed by GitHub
commit 61cd067e7a

@ -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