aboutsummaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2009-08-05 16:56:25 +0200
committerJunio C Hamano <gitster@pobox.com>2009-08-06 13:34:50 -0700
commit4cfbe06fc788aad7bb4e5ea0c2c93345840acc28 (patch)
tree1ddbe9599642fe62d5821fb3a1c120cd7d2944f0 /git-rebase.sh
parent18b07930363d54778e616f1b86de8ccd5ebe88fc (diff)
downloadgit-4cfbe06fc788aad7bb4e5ea0c2c93345840acc28.tar.gz
git-4cfbe06fc788aad7bb4e5ea0c2c93345840acc28.tar.xz
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>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 18bc6946c..3555d17a5 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -382,8 +382,10 @@ else
fi
# The tree must be really really clean.
-if ! git update-index --ignore-submodules --refresh; then
- die "cannot rebase: you have unstaged changes"
+if ! git update-index --ignore-submodules --refresh > /dev/null; then
+ echo >&2 "cannot rebase: you have unstaged changes"
+ git diff --name-status -r --ignore-submodules -- >&2
+ exit 1
fi
diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)
case "$diff" in