summaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-05-21 11:02:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-05-21 11:02:23 (GMT)
commitb7ef48d5d5f0d5b912a5ca84a7079803387586ae (patch)
tree8ad84654ffbdf2071c6a56a08b07c55d0b31eb59 /git-stash.sh
parentdfe0171c4e78f8c392514a825c363251794fba5d (diff)
parent2ba2fe292c13d6442456c1b8a1948bea27992953 (diff)
downloadgit-b7ef48d5d5f0d5b912a5ca84a7079803387586ae.zip
git-b7ef48d5d5f0d5b912a5ca84a7079803387586ae.tar.gz
git-b7ef48d5d5f0d5b912a5ca84a7079803387586ae.tar.bz2
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-xgit-stash.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 908aab2..1d95447 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"
) ) ||