[zsh]add crootgit

This commit is contained in:
Mathieu Maret 2016-05-23 14:56:35 +02:00
parent 3cef108dc7
commit fad6baa93e

View File

@ -129,7 +129,7 @@ sepgrep() {
gettop ()
{
local TOPFILE=build/core/envsetup.mk;
local TOPFILE=$1;
if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ]; then
echo $TOP;
else
@ -150,11 +150,23 @@ gettop ()
fi
}
crootgit ()
{
local TOPFILE=.git/config;
T=$(gettop $TOPFILE);
if [ "$T" ]; then
\cd $(gettop $TOPFILE);
else
echo "Couldn't locate the top of the tree. Try setting TOP.";
fi
}
croot ()
{
T=$(gettop);
local TOPFILE=build/core/envsetup.mk;
T=$(gettop $TOPFILE);
if [ "$T" ]; then
\cd $(gettop);
\cd $(gettop $TOPFILE);
else
echo "Couldn't locate the top of the tree. Try setting TOP.";
fi