Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
027fcccc
Commit
027fcccc
authored
12 years ago
by
Ted Vessenes
Browse files
Options
Download
Email Patches
Plain Diff
Make git use sha when branch name is missing.
parent
d05b2010
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/git.zsh
+2
-1
lib/git.zsh
plugins/git/git.plugin.zsh
+4
-3
plugins/git/git.plugin.zsh
with
6 additions
and
4 deletions
+6
-4
lib/git.zsh
View file @
027fcccc
# get the name of the branch we are on
function
git_prompt_info
()
{
ref
=
$(
git symbolic-ref HEAD 2> /dev/null
)
||
return
ref
=
$(
git symbolic-ref HEAD 2> /dev/null
)
||
\
ref
=
$(
git rev-parse
--short
HEAD 2> /dev/null
)
||
return
echo
"
$ZSH_THEME_GIT_PROMPT_PREFIX
${
ref
#refs/heads/
}
$(
parse_git_dirty
)
$ZSH_THEME_GIT_PROMPT_SUFFIX
"
}
...
...
This diff is collapsed.
Click to expand it.
plugins/git/git.plugin.zsh
View file @
027fcccc
...
...
@@ -50,13 +50,14 @@ alias gsd='git svn dcommit'
# Usage example: git pull origin $(current_branch)
#
function
current_branch
()
{
ref
=
$(
git symbolic-ref HEAD 2> /dev/null
)
||
return
ref
=
$(
git symbolic-ref HEAD 2> /dev/null
)
||
\
ref
=
$(
git rev-parse
--short
HEAD 2> /dev/null
)
||
return
echo
${
ref
#refs/heads/
}
}
function
current_repository
()
{
ref
=
$(
git
symbolic-ref
HEAD 2> /dev/null
)
||
return
ref
=
$(
git symbolic-ref HEAD 2> /dev/null
)
||
\
ref
=
$(
git
rev-parse
--short
HEAD 2> /dev/null
)
||
return
echo
$(
git remote
-v
|
cut
-d
':'
-f
2
)
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help