File bashrc changed (mode: 100644) (index 1daf189..6c24000) |
... |
... |
fi |
631 |
631 |
# echoes full specification of the current branch |
# echoes full specification of the current branch |
632 |
632 |
function B() |
function B() |
633 |
633 |
{ |
{ |
634 |
|
local CUR_DIR="$PWD" |
|
635 |
|
while [ -n "$CUR_DIR" -a ! -d "${CUR_DIR}/.git" ]; do |
|
636 |
|
if [ "$CUR_DIR" = '/' ]; then |
|
637 |
|
break |
|
638 |
|
fi |
|
639 |
|
if [ "${CUR_DIR:1:3}" = ':/' -o "${CUR_DIR:1:3}" = ':' ]; then |
|
640 |
|
break |
|
641 |
|
fi |
|
642 |
|
|
|
643 |
|
CUR_DIR=${CUR_DIR%/*} |
|
644 |
|
done |
|
645 |
|
|
|
646 |
|
if [ -d "${CUR_DIR}/.git" ]; then |
|
647 |
|
local branch="$(<$CUR_DIR/.git/HEAD)" |
|
648 |
|
echo -n "${branch#*: }" |
|
649 |
|
fi |
|
|
634 |
|
# `echo` is just to get rid of a newline |
|
635 |
|
echo -n "$(git rev-parse --symbolic-full-name HEAD)" |
650 |
636 |
} |
} |
651 |
637 |
|
|
652 |
638 |
# echoes basename of the current branch |
# echoes basename of the current branch |