diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-09-10 17:02:54 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-10 17:02:54 +0900 |
commit | 8388f986b6ff1335f8040418579c4365a4c210f2 (patch) | |
tree | 96a5d87e73b3e1c56ce8e39b8e315b939e4d2e15 | |
parent | fbded00b0df5ba7663bddc8e5842a3a118a3c0b3 (diff) | |
parent | 5fc92f8828b117d042344e4733e16195b264365b (diff) | |
download | git-8388f986b6ff1335f8040418579c4365a4c210f2.tar.gz |
Merge branch 'kd/stash-with-bash-4.4' into maint
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
-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 9b6c2da7b4..5f09a47f0a 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" && |