git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Git Mailing List <git@vger.kernel.org>,
	Daniel Barkalow <barkalow@iabervon.org>
Subject: [PATCH] checkout: error out when index is unmerged even with -m
Date: Sat, 23 Feb 2008 15:45:19 -0800	[thread overview]
Message-ID: <7voda7xmnk.fsf_-_@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vzltrz4cl.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Sat, 23 Feb 2008 14:37:46 -0800")

Even when -m is given to allow fallilng back to 3-way merge
while switching branches, we should refuse if the original index
is unmerged.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---

 * I think this bug was inherited from the scripted version.
   Fixing it is much easier here.

 builtin-checkout.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin-checkout.c b/builtin-checkout.c
index 283831e..e028270 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -226,8 +226,8 @@ static int merge_working_tree(struct checkout_opts *opts,
 		refresh_cache(REFRESH_QUIET);
 
 		if (unmerged_cache()) {
-			ret = opts->merge ? -1 :
-				error("you need to resolve your current index first");
+			error("you need to resolve your current index first");
+			return 1;
 		} else {
 			topts.update = 1;
 			topts.merge = 1;

  parent reply	other threads:[~2008-02-23 23:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23 21:36 Be more verbose when checkout takes a long time Linus Torvalds
2008-02-23 22:20 ` Junio C Hamano
2008-02-23 22:32   ` Linus Torvalds
2008-02-23 22:37     ` Junio C Hamano
2008-02-23 23:42       ` Junio C Hamano
2008-02-23 23:45       ` Junio C Hamano [this message]
2008-02-24  6:29         ` [PATCH] checkout: error out when index is unmerged even with -m Daniel Barkalow

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=7voda7xmnk.fsf_-_@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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).