summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.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--interactive.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--interactive.sh')
-rwxr-xr-xgit-rebase--interactive.sh14
1 files changed, 3 insertions, 11 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index a27952d9fd..4d8a2a0e4e 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -153,14 +153,6 @@ run_pre_rebase_hook () {
fi
}
-require_clean_work_tree () {
- # test if working tree is dirty
- git rev-parse --verify HEAD > /dev/null &&
- git update-index --ignore-submodules --refresh &&
- git diff-files --quiet --ignore-submodules &&
- git diff-index --cached --quiet HEAD --ignore-submodules -- ||
- die "Working tree is dirty"
-}
ORIG_REFLOG_ACTION="$GIT_REFLOG_ACTION"
@@ -557,7 +549,7 @@ do_next () {
exit "$status"
fi
# Run in subshell because require_clean_work_tree can die.
- if ! (require_clean_work_tree)
+ if ! (require_clean_work_tree "rebase")
then
warn "Commit or stash your changes, and then run"
warn
@@ -768,7 +760,7 @@ first and then run 'git rebase --continue' again."
record_in_rewritten "$(cat "$DOTEST"/stopped-sha)"
- require_clean_work_tree
+ require_clean_work_tree "rebase"
do_rest
;;
--abort)
@@ -866,7 +858,7 @@ first and then run 'git rebase --continue' again."
comment_for_reflog start
- require_clean_work_tree
+ require_clean_work_tree "rebase" "Please commit or stash them."
if test ! -z "$1"
then