summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2010-10-19 20:09:28 +0530
committerJunio C Hamano <gitster@pobox.com>2010-10-28 13:28:44 -0700
commit92c62a3f4f93432c0c82e3031a9e64e03ba290f7 (patch)
treea17cf82fbe26678b12ab794ab6aeddfb5948fd9b /git-rebase.sh
parentca209065f3cc3462eb0ae6090f6b13f38aa2114c (diff)
downloadgit-92c62a3f4f93432c0c82e3031a9e64e03ba290f7.tar.gz
Porcelain scripts: Rewrite cryptic "needs update" error message
Although Git interally has the facility to differentiate between porcelain and plubmbing commands and appropriately print errors, several shell scripts invoke plubming commands triggering cryptic plumbing errors to be displayed on a porcelain interface. This patch replaces the "needs update" message in git-pull and git-rebase, when `git update-index` is run, with a more friendly message. Reported-by: Joshua Jensen <jjensen@workspacewhiz.com> Reported-by: Thore Husfeldt <thore.husfeldt@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh14
1 files changed, 1 insertions, 13 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index e5df23bb83..988b3d8142 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -416,19 +416,7 @@ else
fi
fi
-# The tree must be really really clean.
-if ! git update-index --ignore-submodules --refresh > /dev/null; then
- echo >&2 "cannot rebase: you have unstaged changes"
- git diff-files --name-status -r --ignore-submodules -- >&2
- exit 1
-fi
-diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)
-case "$diff" in
-?*) echo >&2 "cannot rebase: your index contains uncommitted changes"
- echo >&2 "$diff"
- exit 1
- ;;
-esac
+require_clean_work_tree "rebase" "Please commit or stash them."
if test -z "$rebase_root"
then