rebase: consistent error messages for staged and unstaged changes.
Previous version expose the output of the plumbing update-index to the user, which novice users have difficulty to understand. We still need to run update-index to refresh the cache (if diff.autorefreshindex is false, git diff won't do it). Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
18b0793036
commit
4cfbe06fc7
@ -382,8 +382,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# The tree must be really really clean.
|
# The tree must be really really clean.
|
||||||
if ! git update-index --ignore-submodules --refresh; then
|
if ! git update-index --ignore-submodules --refresh > /dev/null; then
|
||||||
die "cannot rebase: you have unstaged changes"
|
echo >&2 "cannot rebase: you have unstaged changes"
|
||||||
|
git diff --name-status -r --ignore-submodules -- >&2
|
||||||
|
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 --)
|
||||||
case "$diff" in
|
case "$diff" in
|
||||||
|
Reference in New Issue
Block a user