[zsh]add crootgit
This commit is contained in:
parent
3cef108dc7
commit
fad6baa93e
@ -129,7 +129,7 @@ sepgrep() {
|
|||||||
|
|
||||||
gettop ()
|
gettop ()
|
||||||
{
|
{
|
||||||
local TOPFILE=build/core/envsetup.mk;
|
local TOPFILE=$1;
|
||||||
if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ]; then
|
if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ]; then
|
||||||
echo $TOP;
|
echo $TOP;
|
||||||
else
|
else
|
||||||
@ -150,11 +150,23 @@ gettop ()
|
|||||||
fi
|
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 ()
|
croot ()
|
||||||
{
|
{
|
||||||
T=$(gettop);
|
local TOPFILE=build/core/envsetup.mk;
|
||||||
|
T=$(gettop $TOPFILE);
|
||||||
if [ "$T" ]; then
|
if [ "$T" ]; then
|
||||||
\cd $(gettop);
|
\cd $(gettop $TOPFILE);
|
||||||
else
|
else
|
||||||
echo "Couldn't locate the top of the tree. Try setting TOP.";
|
echo "Couldn't locate the top of the tree. Try setting TOP.";
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user