diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-05-21 04:02:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-05-21 04:02:23 -0700 |
commit | b7ef48d5d5f0d5b912a5ca84a7079803387586ae (patch) | |
tree | 8ad84654ffbdf2071c6a56a08b07c55d0b31eb59 /git-stash.sh | |
parent | dfe0171c4e78f8c392514a825c363251794fba5d (diff) | |
parent | 2ba2fe292c13d6442456c1b8a1948bea27992953 (diff) | |
download | git-b7ef48d5d5f0d5b912a5ca84a7079803387586ae.tar.gz |
Merge branch 'cb/maint-stash-orphaned-file'
* cb/maint-stash-orphaned-file:
stash tests: stash can lose data in a file removed from the index
stash: Don't overwrite files that have gone from the index
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-x | git-stash.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git-stash.sh b/git-stash.sh index 908aab2659..1d95447d03 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -86,7 +86,7 @@ create_stash () { GIT_INDEX_FILE="$TMP-index" && export GIT_INDEX_FILE && git read-tree -m $i_tree && - git add -u && + git diff --name-only -z HEAD | git update-index -z --add --remove --stdin && git write-tree && rm -f "$TMP-index" ) ) || |