This repository was archived by the owner on Nov 9, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -183,7 +183,10 @@ ANSI_RESET="\001$(git config --get-color "" "reset")\002"
183183
184184# detect whether the tree is in a dirty state.
185185_git_dirty () {
186- local dirty_marker=" ` git config gitsh.dirty || echo ' *' ` "
186+ if ! git rev-parse --verify HEAD > /dev/null 2>&1 ; then
187+ return 0
188+ fi
189+ local dirty_marker=" ` git config gitsh.dirty 2> /dev/null || echo ' *' ` "
187190
188191 if ! git diff --quiet 2> /dev/null ; then
189192 _git_apply_color " $dirty_marker " " color.sh.dirty" " red"
@@ -199,7 +202,7 @@ _git_dirty_stash() {
199202 if ! git rev-parse --verify refs/stash > /dev/null 2>&1 ; then
200203 return 0
201204 fi
202- local dirty_stash_marker=" ` git config gitsh.dirty-stash || echo ' $' ` "
205+ local dirty_stash_marker=" ` git config gitsh.dirty-stash 2> /dev/null || echo ' $' ` "
203206 _git_apply_color " $dirty_stash_marker " " color.sh.dirty-stash" " red"
204207}
205208
@@ -222,7 +225,7 @@ _git_workdir() {
222225
223226# detect if the repository is in a special state (rebase or merge)
224227_git_repo_state () {
225- local git_dir=" $( git rev-parse --show-cdup) .git"
228+ local git_dir=" $( git rev-parse --show-cdup 2> /dev/null ) .git"
226229 if test -d " $git_dir /rebase-merge" -o -d " $git_dir /rebase-apply" ; then
227230 local state_marker=" (rebase)"
228231 elif test -f " $git_dir /MERGE_HEAD" ; then
You can’t perform that action at this time.
0 commit comments