diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-23 14:13:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-23 14:13:08 -0700 |
commit | ef9408cfb5eca8524047c56ba10df9664425a14c (patch) | |
tree | 4731b7d75b9663de1146c38a0cbfb4e11e47eeea /git-stash.sh | |
parent | 76be4487f08d40bd1dba0d5b0dcbd2513ca26e8c (diff) | |
parent | 5fc92f8828b117d042344e4733e16195b264365b (diff) | |
download | git-ef9408cfb5eca8524047c56ba10df9664425a14c.tar.gz |
Merge branch 'kd/stash-with-bash-4.4'
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
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-x | git-stash.sh | 11 |
1 files changed, 9 insertions, 2 deletions
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" && |