]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-stash.sh
Merge branch 'sh/p4'
[git.git] / git-stash.sh
index 696b465b7c7853f717dca6b2c865647161df25d9..534eb168abf8b0b8ae5c2195bf85b66d9cb6b21e 100755 (executable)
@@ -4,6 +4,7 @@
 USAGE='[ | list | show | apply | clear]'
 
 SUBDIRECTORY_OK=Yes
+OPTIONS_SPEC=
 . git-sh-setup
 require_work_tree
 cd_to_toplevel
@@ -150,7 +151,7 @@ apply_stash () {
        unstashed_index_tree=
        if test -n "$unstash_index" && test "$b_tree" != "$i_tree"
        then
-               git diff --binary $s^2^..$s^2 | git apply --cached
+               git diff-tree --binary $s^2^..$s^2 | git apply --cached
                test $? -ne 0 &&
                        die 'Conflicts in index. Try without --index.'
                unstashed_index_tree=$(git-write-tree) ||
@@ -173,7 +174,7 @@ apply_stash () {
                        git read-tree "$unstashed_index_tree"
                else
                        a="$TMP-added" &&
-                       git diff --cached --name-only --diff-filter=A $c_tree >"$a" &&
+                       git diff-index --cached --name-only --diff-filter=A $c_tree >"$a" &&
                        git read-tree --reset $c_tree &&
                        git update-index --add --stdin <"$a" ||
                                die "Cannot unstage modified files"