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() ...@@ -294,7 +294,8 @@ get_root_git_dir()
which git >/dev/null 2>/dev/null || return 0 which git >/dev/null 2>/dev/null || return 0
if [ -n "$LOCDIR" ] ; then 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 fi
DIR=$(git rev-parse --git-dir 2>/dev/null)/../ DIR=$(git rev-parse --git-dir 2>/dev/null)/../
......
...@@ -8,8 +8,7 @@ get_gear_rules() ...@@ -8,8 +8,7 @@ get_gear_rules()
{ {
local DIR="$1" local DIR="$1"
[ -z "$IGNOREGEAR" ] || return 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" local rules="$GITDIR/.gear/rules"
[ -r "$rules" ] || rules="$GITDIR/.gear-rules" [ -r "$rules" ] || rules="$GITDIR/.gear-rules"
[ -r "$rules" ] || return [ -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