Merge branch 'gh/maint-stash-show-error-message'
* gh/maint-stash-show-error-message: Improve error messages from 'git stash show'maint
commit
f40805be21
|
|
@ -210,14 +210,18 @@ list_stash () {
|
||||||
}
|
}
|
||||||
|
|
||||||
show_stash () {
|
show_stash () {
|
||||||
|
have_stash || die 'No stash found'
|
||||||
|
|
||||||
flags=$(git rev-parse --no-revs --flags "$@")
|
flags=$(git rev-parse --no-revs --flags "$@")
|
||||||
if test -z "$flags"
|
if test -z "$flags"
|
||||||
then
|
then
|
||||||
flags=--stat
|
flags=--stat
|
||||||
fi
|
fi
|
||||||
|
|
||||||
w_commit=$(git rev-parse --verify --default $ref_stash "$@") &&
|
w_commit=$(git rev-parse --quiet --verify --default $ref_stash "$@") &&
|
||||||
b_commit=$(git rev-parse --verify "$w_commit^") &&
|
b_commit=$(git rev-parse --quiet --verify "$w_commit^") ||
|
||||||
|
die "'$*' is not a stash"
|
||||||
|
|
||||||
git diff $flags $b_commit $w_commit
|
git diff $flags $b_commit $w_commit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue