From eb3d46308157e10eb11ec96bcf14b319279d09d3 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 7 Jun 2019 10:57:47 -0500 Subject: gitfast: update to upstream v2.21 (#7914) * gitfast: use $OSTYPE again In the last update to upstream this was reverted: a56eac7a (Use OSTYPE instead of uname whenever possible for better speed. (#5496)) Signed-off-by: Felipe Contreras * gitfast: simplify plugin No need to set and unset a variable we use once. Signed-off-by: Felipe Contreras * gitfast: add script to update from upstream This would make easier the process of updating, and also not miss our patches. Signed-off-by: Felipe Contreras * gitfast: update to upstream v2.21 Signed-off-by: Felipe Contreras --- plugins/gitfast/git-prompt.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/gitfast/git-prompt.sh') diff --git a/plugins/gitfast/git-prompt.sh b/plugins/gitfast/git-prompt.sh index cd905759e..fd2b049db 100644 --- a/plugins/gitfast/git-prompt.sh +++ b/plugins/gitfast/git-prompt.sh @@ -278,11 +278,12 @@ __git_ps1_colorize_gitstring () r="$c_clear$r" } +# Helper function to read the first line of a file into a variable. +# __git_eread requires 2 arguments, the file path and the name of the +# variable, in that order. __git_eread () { - local f="$1" - shift - test -r "$f" && read "$@" <"$f" + test -r "$1" && IFS=$'\r\n' read "$2" <"$1" } # __git_ps1 accepts 0 or 1 arguments (i.e., format string) -- cgit v1.2.3-70-g09d2