summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2013-10-08 10:03:31 +0200
committerHugues Hiegel <hugues.hiegel@qosmos.com>2013-10-08 10:03:31 +0200
commit9ed682ee99d6abc2c4ea412c27da769585cdd1bb (patch)
treed37d1207a5b3477b098c72a4416063e643a726be
parentd0762e3fa173c28cf5b4469c2ddc25edaee28866 (diff)
[Git] name-revs *no-undefined* + *ALWAYS*
-rw-r--r--01_Internal.zsh13
1 files changed, 4 insertions, 9 deletions
diff --git a/01_Internal.zsh b/01_Internal.zsh
index d6ddb73..7cd2aa8 100644
--- a/01_Internal.zsh
+++ b/01_Internal.zsh
@@ -202,13 +202,8 @@ __get_git_branch ()
# If not on a working GIT branch, get the named current commit-ish inside parenthesis
[ "$my_git_branch" = "(no branch)" ] &&\
checkouted_branch="" && \
- my_git_branch="$(git name-rev --name-only HEAD 2>&- | __cleanup_git_branch_name)"
+ my_git_branch="$(git name-rev --name-only --always --no-undefined HEAD 2>&- | __cleanup_git_branch_name)"
- # If neither on a named commit-ish, show commit-id
- if [ "$my_git_branch" = "undefined" ]
- then
- my_git_branch="$(echo $commit_ish | cut -c-7)"
- fi
else
# Initial commit
if [ -L $GIT_DIR/HEAD -a ! -f $GIT_DIR/HEAD ]
@@ -302,7 +297,7 @@ __get_git_branch ()
# ▶ ▷ ▸ ▹ ► ▻ ◀ ◁ ◂ ◃ ◄ ◅
# base
- onto=$(git name-rev --name-only $(cat $REBASE_DIR/onto) | __cleanup_git_branch_name)
+ onto=$(git name-rev --name-only --always --no-undefined $(cat $REBASE_DIR/onto) 2>&- | __cleanup_git_branch_name)
# amended commit
if [ -e $REBASE_DIR/amend ]
@@ -318,9 +313,9 @@ __get_git_branch ()
#
if [ "$amend" != "$commit_ish" ]
then
- #amend=$(git name-rev --name-only "$amend" 2>/dev/null | __cleanup_git_branch_name)
+ #amend=$(git name-rev --name-only --always --no-undefined "$amend" 2>/dev/null | __cleanup_git_branch_name)
#[ "$amend" = "undefined" ] &&
- amend=$(git name-rev --name-only $amend | __cleanup_git_branch_name)
+ amend=$(git name-rev --name-only --always --no-undefined $amend 2>&- | __cleanup_git_branch_name)
amend=" ◃ "$C_$color[magenta]$_C$amend$C_$_prompt_colors[soft_generic]$_C
else
amend=""