[PATCH] rebase: make the warning more useful when the work tree is unclean.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 3, 2007, 05:30 UTC
- Message-ID
- <7vejgchijf.fsf_-_@gitster.siamese.dyndns.org>
- In-Reply-To
- <7vd4vxmmxr.fsf@gitster.siamese.dyndns.org>
Instead of letting "update-index --refresh" report paths needing updates and merges, use git-status to give more useful output.
Signed-off-by: Junio C Hamano <gitster@pobox.com> ---
* I won't be a good judge of the updated behaviour, as I never start rebase in an unclear tree. Running git-status in a large tree may be too expensive to be worth changing the output.
git-rebase.sh | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-rebase.sh b/git-rebase.sh index 1583402..93e3b3c 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -254,7 +254,11 @@ else fi # The tree must be really really clean. -git update-index --refresh || exit +git update-index -q --refresh || { + git status + printf "cannot rebase: the work tree is not clean.\n" + exit 1 +} diff=$(git diff-index --cached --name-status -r HEAD) case "$diff" in ?*) echo "cannot rebase: your index is not up-to-date"
-- 1.5.3.3.1144.gf10f2