From: Junio C Hamano Date: Sun, 20 Aug 2017 06:07:16 +0000 (-0700) Subject: Merge branch 'kd/stash-with-bash-4.4' into next X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/79b2c4b052e93d1aab5183b81621690417583f0a?hp=df47ffeffaca92218437fd143915720bd988e141 Merge branch 'kd/stash-with-bash-4.4' into next bash 4.4 or newer gave a warning on NUL byte in command substitution done in "git stash"; this has been squelched. * kd/stash-with-bash-4.4: stash: prevent warning about null bytes in input --- diff --git a/git-stash.sh b/git-stash.sh index d7bc3224bf..8b2ce9afda 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -43,9 +43,16 @@ no_changes () { } untracked_files () { + if test "$1" = "-z" + then + shift + z=-z + else + z= + fi excl_opt=--exclude-standard test "$untracked" = "all" && excl_opt= - git ls-files -o -z $excl_opt -- "$@" + git ls-files -o $z $excl_opt -- "$@" } clear_stash () { @@ -114,7 +121,7 @@ create_stash () { # Untracked files are stored by themselves in a parentless commit, for # ease of unpacking later. u_commit=$( - untracked_files "$@" | ( + untracked_files -z "$@" | ( GIT_INDEX_FILE="$TMPindex" && export GIT_INDEX_FILE && rm -f "$TMPindex" &&