summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d7b0a09)
raw | patch | inline | side by side (parent: d7b0a09)
author | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 19 Oct 2007 01:28:43 +0000 (21:28 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 19 Oct 2007 01:58:39 +0000 (21:58 -0400) |
git-stash needs to restrict itself to plumbing when running automated
diffs as part of its operation as the user may have configured a
custom diff driver that opens an interactive UI for certain/all
files. Doing that during scripted actions is very unfriendly to
the end-user and may cause git-stash to fail to work.
Reported by Johannes Sixt
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
diffs as part of its operation as the user may have configured a
custom diff driver that opens an interactive UI for certain/all
files. Doing that during scripted actions is very unfriendly to
the end-user and may cause git-stash to fail to work.
Reported by Johannes Sixt
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-stash.sh | patch | blob | history |
diff --git a/git-stash.sh b/git-stash.sh
index 7ba61625baff8236f51d6c0babe9747c43664351..def3163ebbb4f88f800b7cf3c7b856f90b5ae73f 100755 (executable)
--- a/git-stash.sh
+++ b/git-stash.sh
w_commit=$(git rev-parse --verify "$s") &&
b_commit=$(git rev-parse --verify "$s^") &&
- git diff $flags $b_commit $w_commit
+ git diff-tree $flags $b_commit $w_commit
}
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) ||
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"