Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
5918d910
Commit
5918d910
authored
Apr 21, 2014
by
Felipe Contreras
Browse files
gitfast: back-port prompt fix
Signed-off-by:
Felipe Contreras
<
felipe.contreras@gmail.com
>
parent
6a5c8fb8
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/gitfast/git-prompt.sh
View file @
5918d910
...
@@ -259,6 +259,13 @@ __git_ps1_colorize_gitstring ()
...
@@ -259,6 +259,13 @@ __git_ps1_colorize_gitstring ()
r
=
"
$c_clear$r
"
r
=
"
$c_clear$r
"
}
}
eread
()
{
f
=
"
$1
"
shift
test
-r
"
$f
"
&&
read
"
$@
"
<
"
$f
"
}
# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
# when called from PS1 using command substitution
# when called from PS1 using command substitution
# in this mode it prints text to add to bash PS1 prompt (includes branch name)
# in this mode it prints text to add to bash PS1 prompt (includes branch name)
...
@@ -321,9 +328,9 @@ __git_ps1 ()
...
@@ -321,9 +328,9 @@ __git_ps1 ()
local
step
=
""
local
step
=
""
local
total
=
""
local
total
=
""
if
[
-d
"
$g
/rebase-merge"
]
;
then
if
[
-d
"
$g
/rebase-merge"
]
;
then
read
b 2>/dev/null <
"
$g
/rebase-merge/head-name"
e
read
"
$g
/rebase-merge/head-name"
b
read
step 2>/dev/null <
"
$g
/rebase-merge/msgnum"
e
read
"
$g
/rebase-merge/msgnum"
step
read
total 2>/dev/null <
"
$g
/rebase-merge/end"
e
read
"
$g
/rebase-merge/end"
total
if
[
-f
"
$g
/rebase-merge/interactive"
]
;
then
if
[
-f
"
$g
/rebase-merge/interactive"
]
;
then
r
=
"|REBASE-i"
r
=
"|REBASE-i"
else
else
...
@@ -331,10 +338,10 @@ __git_ps1 ()
...
@@ -331,10 +338,10 @@ __git_ps1 ()
fi
fi
else
else
if
[
-d
"
$g
/rebase-apply"
]
;
then
if
[
-d
"
$g
/rebase-apply"
]
;
then
read
step 2>/dev/null <
"
$g
/rebase-apply/next"
e
read
"
$g
/rebase-apply/next"
step
read
total 2>/dev/null <
"
$g
/rebase-apply/last"
e
read
"
$g
/rebase-apply/last"
total
if
[
-f
"
$g
/rebase-apply/rebasing"
]
;
then
if
[
-f
"
$g
/rebase-apply/rebasing"
]
;
then
read
b 2>/dev/null <
"
$g
/rebase-apply/head-name"
e
read
"
$g
/rebase-apply/head-name"
b
r
=
"|REBASE"
r
=
"|REBASE"
elif
[
-f
"
$g
/rebase-apply/applying"
]
;
then
elif
[
-f
"
$g
/rebase-apply/applying"
]
;
then
r
=
"|AM"
r
=
"|AM"
...
@@ -358,7 +365,7 @@ __git_ps1 ()
...
@@ -358,7 +365,7 @@ __git_ps1 ()
b
=
"
$(
git symbolic-ref HEAD 2>/dev/null
)
"
b
=
"
$(
git symbolic-ref HEAD 2>/dev/null
)
"
else
else
local head
=
""
local head
=
""
if
!
read
head
2>/dev/null <
"
$g
/HEAD"
;
then
if
!
e
read
"
$g
/HEAD"
head
;
then
if
[
$pcmode
=
yes
]
;
then
if
[
$pcmode
=
yes
]
;
then
PS1
=
"
$ps1pc_start$ps1pc_end
"
PS1
=
"
$ps1pc_start$ps1pc_end
"
fi
fi
...
...
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