提交 0c3d3ac3 编写于 作者: J Jeff King 提交者: Junio C Hamano

rebase: use plumbing to show dirty state

Commit 4cfbe06f introduced the use of "git diff" to show
dirty state in a format more familiar to users. However, it
should have used the plumbing "git diff-files" instead.

Not only is it good practice in general to use plumbing in
scripts, but in this case we really don't want the automatic
pager to kick in for an error message.
Signed-off-by: NJeff King <peff@peff.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 25fc1786
...@@ -387,7 +387,7 @@ fi ...@@ -387,7 +387,7 @@ fi
# The tree must be really really clean. # The tree must be really really clean.
if ! git update-index --ignore-submodules --refresh > /dev/null; then if ! git update-index --ignore-submodules --refresh > /dev/null; then
echo >&2 "cannot rebase: you have unstaged changes" echo >&2 "cannot rebase: you have unstaged changes"
git diff --name-status -r --ignore-submodules -- >&2 git diff-files --name-status -r --ignore-submodules -- >&2
exit 1 exit 1
fi fi
diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --) diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册