Commit 6f440c39 authored by Vitaly Lipatov's avatar Vitaly Lipatov

get_gear_rules: move path-to-spec support to get_root_git_dir

parent 6d3b2b17
......@@ -294,7 +294,8 @@ get_root_git_dir()
which git >/dev/null 2>/dev/null || return 0
if [ -n "$LOCDIR" ] ; then
cd "$LOCDIR" || fatal "Only dir arg allowed for get_root_git_dir"
[ -f "$LOCDIR" ] && LOCDIR=$(dirname "$LOCDIR")
cd "$LOCDIR" || fatal "get_root_git_dir: dir $LOCDIR does not exists"
fi
DIR=$(git rev-parse --git-dir 2>/dev/null)/../
......
......@@ -8,8 +8,7 @@ get_gear_rules()
{
local DIR="$1"
[ -z "$IGNOREGEAR" ] || return 1
[ -f "$DIR" ] && DIR=$(dirname "$DIR")
local GITDIR=$(get_root_git_dir $DIR)
local GITDIR=$(get_root_git_dir "$DIR")
local rules="$GITDIR/.gear/rules"
[ -r "$rules" ] || rules="$GITDIR/.gear-rules"
[ -r "$rules" ] || return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment