Skip to content

Commit

Permalink
bash: Properly quote the GIT_DIR at all times to fix subdirectory pat…
Browse files Browse the repository at this point in the history
…hs with spaces

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Kevin Ballard authored and Shawn O. Pearce committed Mar 10, 2008
1 parent 50753d0 commit a5c4f85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,25 @@ __git_ps1 ()
elif [ -f "$g/.dotest-merge/interactive" ]
then
r="|REBASE-i"
b="$(cat $g/.dotest-merge/head-name)"
b="$(cat "$g/.dotest-merge/head-name")"
elif [ -d "$g/.dotest-merge" ]
then
r="|REBASE-m"
b="$(cat $g/.dotest-merge/head-name)"
b="$(cat "$g/.dotest-merge/head-name")"
elif [ -f "$g/MERGE_HEAD" ]
then
r="|MERGING"
b="$(git symbolic-ref HEAD 2>/dev/null)"
else
if [ -f $g/BISECT_LOG ]
if [ -f "$g/BISECT_LOG" ]
then
r="|BISECTING"
fi
if ! b="$(git symbolic-ref HEAD 2>/dev/null)"
then
if ! b="$(git describe --exact-match HEAD 2>/dev/null)"
then
b="$(cut -c1-7 $g/HEAD)..."
b="$(cut -c1-7 "$g/HEAD")..."
fi
fi
fi
Expand Down

0 comments on commit a5c4f85

Please sign in to comment.