|
|
@ -66,10 +66,10 @@
|
|
|
|
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
|
|
|
|
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
# _git_promt__git_dir accepts 0 or 1 arguments (i.e., location)
|
|
|
|
# _git_prompt__git_dir accepts 0 or 1 arguments (i.e., location)
|
|
|
|
# echos the location of .git repo.
|
|
|
|
# echos the location of .git repo.
|
|
|
|
# Useful for quickly figuring out if cwd is under a git repo.
|
|
|
|
# Useful for quickly figuring out if cwd is under a git repo.
|
|
|
|
_git_promt__git_dir ()
|
|
|
|
_git_prompt__git_dir ()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if [ -z "${1-}" ]; then
|
|
|
|
if [ -z "${1-}" ]; then
|
|
|
|
if [ -d .git ]; then
|
|
|
|
if [ -d .git ]; then
|
|
|
@ -229,7 +229,7 @@ _git_prompt__rebase_info ()
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
local r=""
|
|
|
|
local r=""
|
|
|
|
local g="$(_git_promt__git_dir)"
|
|
|
|
local g="$(_git_prompt__git_dir)"
|
|
|
|
if [ -n "$g" ]; then
|
|
|
|
if [ -n "$g" ]; then
|
|
|
|
if [ -f "$g/rebase-merge/interactive" ]; then
|
|
|
|
if [ -f "$g/rebase-merge/interactive" ]; then
|
|
|
|
r="|REBASE-i"
|
|
|
|
r="|REBASE-i"
|
|
|
@ -276,7 +276,7 @@ _git_prompt__branch ()
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
local b=""
|
|
|
|
local b=""
|
|
|
|
local g="$(_git_promt__git_dir)"
|
|
|
|
local g="$(_git_prompt__git_dir)"
|
|
|
|
if [ -n "$g" ]; then
|
|
|
|
if [ -n "$g" ]; then
|
|
|
|
if [ -f "$g/rebase-merge/interactive" ]; then
|
|
|
|
if [ -f "$g/rebase-merge/interactive" ]; then
|
|
|
|
b="$(cat "$g/rebase-merge/head-name")"
|
|
|
|
b="$(cat "$g/rebase-merge/head-name")"
|
|
|
@ -421,7 +421,7 @@ _git_prompt__dirty_state ()
|
|
|
|
return
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
local g="$(_git_promt__git_dir)"
|
|
|
|
local g="$(_git_prompt__git_dir)"
|
|
|
|
if [ -z "$g" ]; then
|
|
|
|
if [ -z "$g" ]; then
|
|
|
|
return
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|