summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--01_Functions.zsh13
1 files changed, 10 insertions, 3 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh
index 11124de..75be2a3 100644
--- a/01_Functions.zsh
+++ b/01_Functions.zsh
@@ -70,9 +70,16 @@ get_git_branch ()
[ "$my_git_branch" == "(no branch)" ] &&\
my_git_branch="($(git-name-rev HEAD 2>&- | awk '{ print $2 }' | sed 's,^tags/,,;s,^remotes/,,'))"
- # If neither on a named commit-ish, show abbreviated commit-id
- [ "$my_git_branch" == "(undefined)" ] &&\
- my_git_branch="($(git-rev-parse HEAD 2>&-))"
+ # If neither on a named commit-ish, show commit-id
+ if [ "$my_git_branch" == "(undefined)" ]
+ then
+ if [ -e $(git-rev-parse --git-dir)/.dotest-merge/git-rebase-todo ]
+ then
+ my_git_branch="(rebase: $(git-rev-parse HEAD 2>&-))"
+ else
+ my_git_branch="($(git-rev-parse HEAD 2>&-))"
+ fi
+ fi
fi
echo $my_git_branch