From: Junio C Hamano Date: Fri, 21 May 2010 11:02:23 +0000 (-0700) Subject: Merge branch 'cb/maint-stash-orphaned-file' X-Git-Tag: v1.7.2-rc0~105 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b7ef48d5d5f0d5b912a5ca84a7079803387586ae?ds=inline;hp=-c 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 --- b7ef48d5d5f0d5b912a5ca84a7079803387586ae diff --combined git-stash.sh index 908aab2659,0f858d334c..1d95447d03 --- a/git-stash.sh +++ b/git-stash.sh @@@ -57,7 -57,7 +57,7 @@@ create_stash () # state of the base commit if b_commit=$(git rev-parse --verify HEAD) then - head=$(git log --no-color --abbrev-commit --pretty=oneline -n 1 HEAD --) + head=$(git rev-list --oneline -n 1 HEAD --) else die "You do not have the initial commit yet" fi @@@ -86,7 -86,7 +86,7 @@@ 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" ) ) ||