git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <bebarino@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] pull, rebase: simplify to use die()
Date: Sun, 14 Jun 2009 16:08:56 -0700	[thread overview]
Message-ID: <1245020936-7978-1-git-send-email-bebarino@gmail.com> (raw)

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---

I noticed these, and they're somewhat unrelated from the quiet
stuff.

 git-pull.sh   |    6 ++----
 git-rebase.sh |    9 +++------
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/git-pull.sh b/git-pull.sh
index 3526153..cab367a 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -176,13 +176,11 @@ case "$merge_head" in
 ?*' '?*)
 	if test -z "$orig_head"
 	then
-		echo >&2 "Cannot merge multiple branches into empty head"
-		exit 1
+		die "Cannot merge multiple branches into empty head"
 	fi
 	if test true = "$rebase"
 	then
-		echo >&2 "Cannot rebase onto multiple branches"
-		exit 1
+		die "Cannot rebase onto multiple branches"
 	fi
 	;;
 esac
diff --git a/git-rebase.sh b/git-rebase.sh
index b83fd3f..334629f 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -168,10 +168,8 @@ run_pre_rebase_hook () {
 	if test -z "$OK_TO_SKIP_PRE_REBASE" &&
 	   test -x "$GIT_DIR/hooks/pre-rebase"
 	then
-		"$GIT_DIR/hooks/pre-rebase" ${1+"$@"} || {
-			echo >&2 "The pre-rebase hook refused to rebase."
-			exit 1
-		}
+		"$GIT_DIR/hooks/pre-rebase" ${1+"$@"} ||
+		die "The pre-rebase hook refused to rebase."
 	fi
 }
 
@@ -359,8 +357,7 @@ fi
 
 # The tree must be really really clean.
 if ! git update-index --ignore-submodules --refresh; then
-	echo >&2 "cannot rebase: you have unstaged changes"
-	exit 1
+	die "cannot rebase: you have unstaged changes"
 fi
 diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)
 case "$diff" in
-- 
1.6.3.2.306.g4f4fa

                 reply	other threads:[~2009-06-14 23:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1245020936-7978-1-git-send-email-bebarino@gmail.com \
    --to=bebarino@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).