completion: use __gitcomp_builtin in _git_am
[gitweb.git] / contrib / completion / git-prompt.sh
index c6cbef38c2a580555dfcdc67e04f6ac507f9066c..983e419d2b7eda8f191a878a395179dcc24eb949 100644 (file)
@@ -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)