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
cf5db83f
Commit
cf5db83f
authored
9 years ago
by
Victor Torres
Browse files
Options
Download
Email Patches
Plain Diff
Implementing mcornella's suggestions in pull request 4451.
parent
d49cacfb
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/branch/branch.plugin.zsh
+7
-7
plugins/branch/branch.plugin.zsh
with
7 additions
and
7 deletions
+7
-7
plugins/branch/branch.plugin.zsh
View file @
cf5db83f
...
...
@@ -4,23 +4,23 @@
function
branch_prompt_info
()
{
# Defines path as current directory
path
=
$(
pwd
)
local
current_dir
=
$PWD
# While current path is not root path
while
[
$
path
!=
'/'
]
;
while
[
[
$
current_dir
!=
'/'
]
]
do
# Git repository
if
[
-d
${
path
}
/.git
]
;
if
[
[
-d
"
${
current_dir
}
/.git
"
]
]
then
echo
'±'
$
(
/bin/cat
${
path
}
/.git/HEAD | /usr/bin/cut
-d
/
-f
3-
)
echo
'±'
$
{
"
$(
<
"
$current_dir
/.git/HEAD"
)
"
##*/
}
return
;
fi
# Mercurial repository
if
[
-d
${
path
}
/.hg
]
;
if
[
[
-d
"
${
current_dir
}
/.hg
"
]
]
then
echo
'☿'
$(
/bin/cat
${
path
}
/.hg/branch
)
echo
'☿'
$(
<
"
$current_dir
/.hg/branch
"
)
return
;
fi
# Defines path as parent directory and keeps looking for :)
path
=
$(
/usr/bin/dirname
$path
)
current_dir
=
"
${
current_dir
:h
}
"
done
}
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