mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
Allow current_branch to be used in subdirectories of a git repo
This commit is contained in:
parent
da94f45f9c
commit
43e6488025
1 changed files with 0 additions and 1 deletions
|
|
@ -125,7 +125,6 @@ alias gsd='git svn dcommit'
|
|||
# Usage example: git pull origin $(current_branch)
|
||||
#
|
||||
function current_branch() {
|
||||
if [ ! -d .git ]; then return; fi
|
||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
||||
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
||||
echo ${ref#refs/heads/}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue